fix: runtime crash in dropdowns from headlessui v2 Fragment check (React 19 upgrade regression) - #9694
Conversation
Combobox.Button as={Fragment} requires its child to be a single real
element. Wrapping the button ternary in <>...</> made the child a
Fragment instance itself, which @headlessui/react v2 rejects with
"Passing props on Fragment!" at runtime. Dropping the wrapper fixes
priority, estimate, intake-state, member, module, cycle, state, and
project dropdowns.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR removes unnecessary React fragment wrappers from conditional ChangesDropdown combo button JSX
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change removes redundant Fragment wrappers so the eight dropdown buttons render correctly with the upgraded UI library while preserving their existing behavior and interfaces. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Description
The React 19 upgrade (#9530) bumped
@headlessui/reactv1.7.19 → v2.2.10 (required — v1 reads APIs removed in React 19). Headless UI v2 added a stricter check onCombobox.Button as={Fragment}sites: the child must resolve to a single real element, not a Fragment.Eight dropdown components (
priority,estimate,intake-state,member,module,cycle,state,project) had a pre-existing, previously-harmless pattern of wrapping their button ternary in<>{cond ? <button/> : <button/>}</>before passing it toCombobox.Button. Under v1 this was silently tolerated; under v2 the child'stype === Fragmentnow throws"Passing props on Fragment!"at runtime — crashing these dropdowns onpreviewpost-#9530.Fix: drop the redundant outer
<>...</>in each of the 8 files — the ternary already evaluates to a single element, so the Fragment wrapper was never needed.Type of Change
Test Scenarios
pnpm --filter web run check:types— zero errorspnpm run build— 16/16 tasks passReferences
Runtime regression introduced by the
@headlessui/reactv1→v2 bump in #9530 (React 19 upgrade), which surfaced this latent Fragment-wrap bug.Summary by CodeRabbit