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

fix: dont error on nullish prop values in jsx runtime #10584

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

duanwilliam
Copy link
Contributor

resolves #10575

Changes

  • jsx runtime no longer errors on non-.astro jsx function component instances represented as vnode objects with nullish prop values
    • only try property access on non-nullish prop values when checking if a prop is a slot

Testing

tested locally (ran dev server for @examples/with-mdx and added reproduction sample from linked issue)

not sure where a test file would best go or how to construct it, since particular reproduction from linked issue uses mdx, but don't think mdx is actually necessary, merely an environment where the issue could naturally occur.

Docs

not needed, internal bugfix

Copy link

changeset-bot bot commented Mar 27, 2024

🦋 Changeset detected

Latest commit: 100d2e1

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

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 27, 2024
@duanwilliam duanwilliam changed the title fix: fix: handle nullish prop values in jsx runtime Mar 27, 2024
@duanwilliam duanwilliam changed the title fix: handle nullish prop values in jsx runtime fix: dont error trying to render components with nullish prop values in jsx-runtime Mar 27, 2024
@duanwilliam duanwilliam changed the title fix: dont error trying to render components with nullish prop values in jsx-runtime fix: dont error on nullish prop values in jsx-runtime Mar 27, 2024
@duanwilliam duanwilliam changed the title fix: dont error on nullish prop values in jsx-runtime fix: dont error on nullish prop values in jsx runtime Mar 27, 2024
Copy link
Contributor

@lilnasy lilnasy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Excellent work finding the fix, I was pleasantly surprised by the investigation in the original report.

@ematipico ematipico merged commit e648c55 into withastro:main Mar 29, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 29, 2024
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
3 participants