0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-31 23:31:30 -05:00

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

* fix: prevent jsx runtime from erroring on nullish prop values when checking for slot props

* chore: changeset
This commit is contained in:
duanwilliam 2024-03-29 03:14:25 -07:00 committed by GitHub
parent 0ff5d72c78
commit e648c5575a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fixes a bug where JSX runtime would error on components with nullish prop values in certain conditions.

View file

@ -116,7 +116,7 @@ Did you forget to import the component or is it possible there is a typo?`);
}
extractSlots(children);
for (const [key, value] of Object.entries(props)) {
if (value['$$slot']) {
if (value?.['$$slot']) {
_slots[key] = value;
delete props[key];
}