-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Tabs/Tab component enhancements #3397
Comments
At some point between 10.2 and 10.3 a regression caused the tabs content to not properly render, the result being an undefined element. In my opinion, special care should be used around the React helpers. They'll be required here to add an index to the tabs. However, I think the top level helpers should likely be avoided if using JSX is possible, as mixing cloneElement, with JSX, with mapping over children can make the component harder to reason about. In summary, This code worked with 7.2
This code is required for 7.3+
|
@vpicone could you provide more info to help with isolating the issue? |
@joshblack I'm not sure, only the props set in the cloneElement call are making it to the component. Seems like we could address this using the TabContent as a default in the Tabs component and not relying on default props of Tab? Seems like there's some discrepancy in when default props are loaded for create and clone element in react but I'm not sure if that has any relevancy. |
All things equal (mdx/gatsby/other deps) Tabs worked in 7.2 but not 7.3+ so I don't think we can blame MDX here but I could be wrong. |
@vpicone I'm not suggesting MDX is to blame, I'm requesting that we offer more details to help reproduce and fix the issue. This seems to be coming up when used alongside MDX, but if this is an issue outside of this scope then that's totally fine 👍 As long as there is a way for someone working on this to reproduce, identify, and fix the issue. |
We've marked this issue as stale because there hasn't been any activity for a couple of weeks. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions. |
As there's been no activity since this issue was marked as stale, we are auto-closing it. |
We should schedule some time to refactor/update the tab components with the following constraints in mind:
getDerivedStateFromProps
null
and wrapped children accordinglyrenderContent
as adefaultProp
may not be properly hoisted and is causing issues within MDXThe text was updated successfully, but these errors were encountered: