How to wrap @react-stately/collections's <Item/> (and preserve key) #1975
-
I am experimenting to combine I tried wrapping the component by doing the following:
But this throws an error
I then tried some custom logic by using the parent to loop trough the custom So I am wondering, is there any better solution to wrap an I can imagine from an API standpoint it's very convenient to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We intend for Item to be the outermost in React Spectrum components. In this particular case though, we’d recommend using the programmatic API to navigate between routes in onSelectionChange |
Beta Was this translation helpful? Give feedback.
We intend for Item to be the outermost in React Spectrum components.
If you're using our hooks though, you would probably want to create your own Item components. You could look at how we construct various Item components in order to make your own https://github.com/adobe/react-spectrum/search?q=getCollectionNode
In this particular case though, we’d recommend using the programmatic API to navigate between routes in onSelectionChange