Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAC] TabPanel shouldForceMount logs React error #7502

Open
bradlc opened this issue Dec 10, 2024 · 2 comments · May be fixed by #7519
Open

[RAC] TabPanel shouldForceMount logs React error #7502

bradlc opened this issue Dec 10, 2024 · 2 comments · May be fixed by #7519
Labels
bug Something isn't working good first issue Good for newcomers react 19

Comments

@bradlc
Copy link

bradlc commented Dec 10, 2024

Provide a general summary of the issue here

Using shouldForceMount with <TabPanel> logs a React error.

🤔 Expected Behavior?

Using shouldForceMount should not log an error.

😯 Current Behavior

React logs the following error:

Received the string `true` for the boolean attribute `inert`. Although this works, it will not work as expected if you pass the string "false". Did you mean inert={true}?

https://github.com/facebook/react/blob/372ec00c0384cd2089651154ea7c67693ee3f2a5/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js#L323

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

https://stackblitz.com/edit/stackblitz-starters-yvbwhznr?file=app%2FClient.tsx

'use client';

import { Tabs, TabList, Tab, TabPanel } from 'react-aria-components';

export function Client() {
  return (
    <Tabs>
      <TabList aria-label="History of Ancient Rome">
        <Tab id="FoR">Founding of Rome</Tab>
        <Tab id="MaR">Monarchy and Republic</Tab>
        <Tab id="Emp">Empire</Tab>
      </TabList>
      <TabPanel id="FoR">
        Arma virumque cano, Troiae qui primus ab oris.
      </TabPanel>
      <TabPanel id="MaR" shouldForceMount>
        Senatus Populusque Romanus.
      </TabPanel>
      <TabPanel id="Emp">Alea jacta est.</TabPanel>
    </Tabs>
  );
}

Version

[email protected]

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS 15.1.1

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@devongovett
Copy link
Member

I believe this changed in React 19. It needs to be a string for older versions so I guess we'll have to do a version check...

@snowystinger snowystinger added bug Something isn't working good first issue Good for newcomers labels Dec 10, 2024
@LFDanLu
Copy link
Member

LFDanLu commented Dec 11, 2024

We'll need to do an audit in our codebase for any other usages of inert as well, looks like Breadcrumbs and TagGroup also make use it it too.

@chirokas chirokas linked a pull request Dec 13, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers react 19
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants