Modal.browser.test.tsx emits WARN: A component changed from uncontrolled to controlled nine times. isOpen goes undefined → defined as the component moves between the prop-driven and the controller-driven path, and react-aria's useControlledState warns on that transition.
Same class as the Tabs defect fixed in #3025, and probably the same shape of fix — useControlledState treats only undefined as uncontrolled, so passing null for "controlled, nothing open yet" keeps the component on one side of the line. But Modal has two independent ways to drive its open state, so the correct default is a judgement call rather than a mechanical swap, and it deserves its own look.
Provenance
Found while fixing #3014 and verified pre-existing: the count is identical with the #3025 changes reverted. It was not among the 8 + 14 occurrences in #3014's reproduction list — those all traced to Tabs and ModalTrigger — so it was deliberately left out of that PR rather than folded in.
Reproducing
pnpm nx test:browser components --browser.name=webkit
and read the Modal.browser.test.tsx output; the warning appears nine times.
Modal.browser.test.tsxemitsWARN: A component changed from uncontrolled to controllednine times.isOpengoesundefined→ defined as the component moves between the prop-driven and the controller-driven path, and react-aria'suseControlledStatewarns on that transition.Same class as the
Tabsdefect fixed in #3025, and probably the same shape of fix —useControlledStatetreats onlyundefinedas uncontrolled, so passingnullfor "controlled, nothing open yet" keeps the component on one side of the line. ButModalhas two independent ways to drive its open state, so the correct default is a judgement call rather than a mechanical swap, and it deserves its own look.Provenance
Found while fixing #3014 and verified pre-existing: the count is identical with the #3025 changes reverted. It was not among the 8 + 14 occurrences in #3014's reproduction list — those all traced to
TabsandModalTrigger— so it was deliberately left out of that PR rather than folded in.Reproducing
and read the
Modal.browser.test.tsxoutput; the warning appears nine times.