You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix 'Invalid prop data-headlessui-state supplied to React.Fragment' warning (#3788)
This PR fixes an issue in React 19 where a warning is shown in the
console:
```
Invalid prop `data-headlessui-state` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.
```
This PR fixes that by doing 2 things:
1. We make sure that we properly check for `Fragment`. We were relying
on identity, but will now also check the underlying symbol.
2. Make sure that the element we forward props to is not a `Fragment`
either.
## Test plan
- All existing tests still pass (this codebase is using React 18 instead
of 19,
where we can't reproduce the warning)
- Tested in a reproduction repo with React 19 that the warning is gone.
Before:
<img width="1190" height="849" alt="image"
src="https://github.com/user-attachments/assets/c2fd061c-4b6b-4685-a59c-c0edc6eb8642"
/>
After:
<img width="1190" height="849" alt="image"
src="https://github.com/user-attachments/assets/ee8318b6-06fa-4fa7-84bf-b96af3a34f87"
/>
Fixes: #3597Fixes: #3351
0 commit comments