Provide a general summary of the issue here
When setting the selectedKey on RAC Tabs to null, Error: Maximum update depth exceeded. is thrown repeatedly and the browser freezes up due to the infinite rerender.
🤔 Expected Behavior?
Tabs should render with no Tab selected when selectedKey is null, since null is allowed by the SingleSelection types
😯 Current Behavior
Tabs infinitely rerenders when selectedKey is null and throws errors repeatedly.
💁 Possible Solution
Seems to be a regression in RAC 1.14. I bisected RAC nightlies and found it was introduced between 3.0.0-nightly-0836d3a4e-251017 and 3.0.0-nightly-02433d1f1-251018, so most likely #9041 and the resulting extra rerender. However, this seems like a logic issue in useTabListState so I think it can be fixed there
A workaround is to set the selectedKey to a nonexistent Key instead of null in order to control the "no tab selected" state
🔦 Context
There is a case where Tabs state is controlled and initially nothing is selected, so it seems reasonable to pass null as the selectedKey
🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/peaceful-jackson-lxxwyr (open the browser console)
Version
RAC 1.14.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS 15
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Provide a general summary of the issue here
When setting the
selectedKeyon RAC Tabs to null,Error: Maximum update depth exceeded.is thrown repeatedly and the browser freezes up due to the infinite rerender.🤔 Expected Behavior?
Tabs should render with no Tab selected when
selectedKeyis null, since null is allowed by theSingleSelectiontypes😯 Current Behavior
Tabs infinitely rerenders when
selectedKeyis null and throws errors repeatedly.💁 Possible Solution
Seems to be a regression in RAC 1.14. I bisected RAC nightlies and found it was introduced between
3.0.0-nightly-0836d3a4e-251017and3.0.0-nightly-02433d1f1-251018, so most likely #9041 and the resulting extra rerender. However, this seems like a logic issue inuseTabListStateso I think it can be fixed thereA workaround is to set the
selectedKeyto a nonexistent Key instead of null in order to control the "no tab selected" state🔦 Context
There is a case where Tabs state is controlled and initially nothing is selected, so it seems reasonable to pass null as the
selectedKey🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/peaceful-jackson-lxxwyr (open the browser console)
Version
RAC 1.14.0
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS 15
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response