Wrapper Component for Item
#4270
Unanswered
ashleyryan
asked this question in
Q&A
Replies: 1 comment
-
For now this isn't really supported, though you started having the right idea of how you could implement it with getCollectionNode. However, often you can make a component that you put inside In the future wrapping Item will be supported, however. See this section of our recent React Aria Components RFC for more details on how that will work. |
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
-
I have a custom Item component for my Listbox that doesn't do much besides add some props to the type definition that get used when we render an
li
.It's something like this:
This works pretty well, but I have another component where, for backwards compatibility, I need to accept a
value
prop and convert that to the Item'skey
prop. I can't do that in ListboxOption, because that's not a real component that gets rendered.I did try to wrap the
getCollectionNode
generator function on the item like this, but that doesn't work either, the collection code pulls key before this gets called.Is there any way to wrap an item or map props to accept a different prop name for key?
Beta Was this translation helpful? Give feedback.
All reactions