-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Improve Tab Props #1859
Comments
You have this warning because unhandled props are passed to the root element of const paneProps = { foo: 'foo' }
const panes = [
{ menuItem: 'Tab 1', render: () => <Tab.Pane {...paneProps}>Tab 1 Content</Tab.Pane> },
{ menuItem: 'Tab 2', render: () => <Tab.Pane {...paneProps}>Tab 2 Content</Tab.Pane> },
]
const TabExampleBasic = () => (
<Tab panes={panes} />
) I'm pretty sure that the new prop isn't required. |
I had actually considered this as well. Most often, every pane will be rendered with mostly the same props. I'm still not completely convinced one way or the either, so I had defaulted to the minimal case. |
I'm closed this for housekeeping, however the issue can be reopened after @rostero1's answer. |
@EdsonAlcala create the |
I am confused about this const panes array. Is the following approach the right way to pass props to panes?
|
Should you have two items with same
It uses menuItem as key. I'd suggest using |
Please open new issues with complete reports for the best help. |
Tab
is a nice addition. The problem I'm having is that I want to pass props to my tab panes (render functions). To do this I'm doing<Tab panes={panes} foo="foo" />
, which returnsUnknown prop
fooon <div> tag. Remove this prop from the element. For details, see
. Can we have a new prop, like paneProps that we use just for the render props?Also, can we have take in Tab.Pane children in addition to a panes list prop?
The text was updated successfully, but these errors were encountered: