Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic components do not work with scoped slots #4871

Open
nolanlawson opened this issue Nov 15, 2024 · 1 comment
Open

Dynamic components do not work with scoped slots #4871

nolanlawson opened this issue Nov 15, 2024 · 1 comment
Labels

Comments

@nolanlawson
Copy link
Collaborator

With scoped slots, this works:

<x-counter>
    <template lwc:slot-data="data">
        <span>{data.id} - {data.name}</span>
    </template>
</x-counter>

However, if that same <x-counter> component is used with <lwc:component> (aka dynamic components):

<lwc:component lwc:is={customCtor}>
    <template lwc:slot-data="data">
        <span>{data.id} - {data.name}</span>
    </template>
</lwc:component>

... then you get an error at compile time:

Error: LWC1178: <template> tag with lwc:slot-data directive must be the direct child of a custom element.

Repro

@nolanlawson
Copy link
Collaborator Author

See #4920 which contains fixture tests that should be updated once this bug is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant