Replies: 1 comment
-
Instead of setting it on Item, just send it as a child or as a prop on the child As for passing other things as props on Item, you can see our implementation of Tab where we allow people to set any data-* attribute they want |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using e.g.
useTabList
, I'd like every tab to not just have a text label, but also an icon. Looking at the type definitions, I see that e.g.TabListProps
takes a generic parameter that ends up onNode
, and allows you to define extra properties (e.g.Node<{ icon: ReactNode }>
) that you can access when accessing a particular item (e.g. usingprops.item.value.icon
).However, I don't see how I can actually set those properties - I can't just add extra props to
<Item>
, e.g. like this:How do you pass custom properties to a collection item? I've seen this answer to a similar question, but as I understand it that just extends the type definition of an
<Item>
- I don't think that actually allows me to set additional properties that I can access?(Or alternatively, what's the best way to provide tab icons?)
Beta Was this translation helpful? Give feedback.
All reactions