astro
astro copied to clipboard
🐛 BUG: Astro.slots callback not receiving arguments as documented
What version of astro
are you using?
1.0.0-beta.42
Are you using an SSR adapter? If so, which one?
none
What package manager are you using?
npm
What operating system are you using?
Stackblitz
Describe the Bug
We document the usage of the Astro.slots.render
method passing arguments from a component to a slotted callback method, but the example does not currently work as expected:
If the component calls render
like this:
Astro.slots.render('default', Astro.props.messages);
And the is used like this:
<Message messages={['Hello', 'world!']}>
{(messages) => messages.join(' ')}
</Message>
messages
is undefined.
This was reported in https://github.com/withastro/docs/issues/595 and we confirmed this behaviour with @sarah11918 and @natemoo-re this evening and we’re removing the docs for this for now (https://github.com/withastro/docs/pull/740).
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-csutf1?file=package.json
Participation
- [ ] I am willing to submit a pull request for this issue.