Astro.slots.render() docs should explicitly mention that component scripts are "consumed" by the first call
#14074
TimonLukas
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(follow-up on #14042)
If a component receives slot content with Astro components and the slot is rendered multiple times (e.g. by repeated
Astro.slots.rendercalls, or by callingAstro.slots.renderwhile a<slot />with the same name exists), only the first render will emit the scripts of the slotted components. Both of these examples will not be interactive:The Script processing docs mention this tangentially:
When I first read this I assumed the deduplication to be a post-processing step, so the stateful nature felt surprising. IMO it would be helpful to explicitly mention this behavior in the
Astro.slots.renderdocs, and maybe to clarify the Deduplication point quoted above.For the
Astro.slots.renderdocs, I'd propose to add something like this to the existing:::note:Beta Was this translation helpful? Give feedback.
All reactions