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

Add function-based slot support to Astro.slots.render() #2954

Merged
merged 2 commits into from
Mar 31, 2022
Merged

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Mar 31, 2022

Changes

  • Previously, Astro.slots.render("default") could only render Astro components.
  • Now, Astro.slots.render("default", [...args]) can render a function child, passing args into the function correctly.
  • This allows users to build more ergonomic utility components like For.
<For each={items}>
  {(item) => <li>{item}</li>}
</For>

Testing

Test suite added for Astro.slots.render('default') and Astro.slots.render('default', [args])

Docs

TBD

@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2022

🦋 Changeset detected

Latest commit: a6519ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 31, 2022
@github-actions github-actions bot added the test label Mar 31, 2022
@aFuzzyBear
Copy link
Contributor

THIS IS AMAZING!!!
sorry bit carried away there lol

@natemoo-re natemoo-re merged commit d81b6d9 into main Mar 31, 2022
@natemoo-re natemoo-re deleted the feat/fn-slots branch March 31, 2022 18:11
@github-actions github-actions bot mentioned this pull request Mar 31, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
…2954)

* feat(slots): add function-based slot support to Astro.slots.render()

* test(slots): add render tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants