-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
React does not recognize the isSideNavExpanded
prop on a DOM element
#3970
Comments
Should be closed by #4349! Let me know if that isn't the case and I'd be happy to re-open 😄 |
Apologies for the delay, I completely lost track of this one. I've just updated to 10.9.2/7.9.2 and confirmed it's resolved 👍 Thanks |
@joshblack Hi josh, I still having the same problem with ts 😢 What package(s) are you using?
Detailed descriptionconsole
using component
|
Hi @joshblack , The error is going on. I'm using the following packages: "carbon-components": "^10.11.2", |
@muratumutlu I'm not a Carbon developer. I'm just a user like you who reported an issue I found, and it was resolved for my use case in the versions I mentioned in my last comment. You should probably open a new issue with details of what you're seeing, including a codesandbox reproducing it if possible. That will make it easier for the Carbon team to debug. |
Sorry @AlanGreene , I've seen your message about "it's resolved" and then I post this message. Now I'm changing my message. Thank you for the information. |
Im having same issue as @KimWooHyun or @AlanGreene in version: |
Hi @joshblack , I'm also having the issue with |
Does anyone have a link to a reproducible example? The example using https://react.carbondesignsystem.com/iframe.html?id=ui-shell--sidenav-rail-w-header |
I'm not seeing the issue, but React only emits those warnings in dev mode so you'd need to run the storybook locally in dev mode to see it if it's happening there. |
It's still there on {
"carbon-components": "^10.15.0",
"carbon-components-react": "^7.15.0"
} |
|
I've just tested locally in dev mode and on the deployed production version and I'm unable to reproduce this issue. My main recommendation is to ensure you are running the latest version of the components and see if it still exists. Closing this since I am unable to reproduce, but I will reopen if someone can provide a CodeSandbox reproducing this issue. Thanks! |
The way I see it:
|
I believe however that the message above does, however, explain the problem quite thoroughly & the fix could be as easy as catching the |
@kubijo Thanks for taking the time to investigate this. I'll make a PR to catch the |
OK guys, the problem persists in |
For what it's worth, this is the tail of stack-trace that I get Edit: found the culprit… it's about this line & the fact that our designers require some custom elements in the menus (titles). You are injecting the prop to whatever gets into children. Couldn't you use a React context and flip the solution to ask for value in components that might need it instead of forcing it upon everything? For others … For now, I've been able to fix it this way … or just wrap it in |
@kubijo would you mind sharing a reduced test case in a ZIP if Code Sandbox is still not playing nice? |
If I understood it correctly this should be the link https://codesandbox.io/s/magical-clarke-ldj9i?file=/src/index.js |
What package(s) are you using?
carbon-components
- 10.6.1 (latest)carbon-components-react
- 7.6.1 (latest)Detailed description
It looks like #3626 introduced a warning about unrecognized props being applied to DOM elements.
here, the props (including
isSideNavExpanded
) are being spread ontoelement
:carbon/packages/react/src/components/UIShell/Link.js
Line 19 in 99f12f9
The Carbon components should not be passing through all props like this, instead they should filter out those that are not supported / relevant for the target component / element, or explicitly pass only the expected props to their children.
Having these warnings causes a lot of noise in logs, both in the browser and in tests, making it harder to spot / debug genuine problems.
Steps to reproduce the issue
This can be reproduced by running the storybook in dev mode
npm run storybook
Additional information
The text was updated successfully, but these errors were encountered: