You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, we're using react-aria-components, specifically the ListBox. We want to have a wrapper around a ListBoxItem, but found that we weren't able to access any contexts that should have been provided by ListBox, such as ListBoxContext or ListStateContext. I was able to verify that the ListBox rendered the contexts, by stepping through the code and also checking the React component tree. However, child elements were not able to access the contexts. Is this expected?
Or am I supposed to wrap the ListBox with my own instance of ListBoxContext.Provider? I noticed in ListBox.test.js it could be used both ways.
Note I also tried it for some other components such as Select, and the SelectContext is available to child elements.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, we're using react-aria-components, specifically the ListBox. We want to have a wrapper around a ListBoxItem, but found that we weren't able to access any contexts that should have been provided by ListBox, such as ListBoxContext or ListStateContext. I was able to verify that the ListBox rendered the contexts, by stepping through the code and also checking the React component tree. However, child elements were not able to access the contexts. Is this expected?
Or am I supposed to wrap the ListBox with my own instance of ListBoxContext.Provider? I noticed in ListBox.test.js it could be used both ways.
Note I also tried it for some other components such as Select, and the SelectContext is available to child elements.
I have a minimal reproduction here: https://github.com/plasmicapp/react-aria-components-test
I found a similar issue here: #6319
Beta Was this translation helpful? Give feedback.
All reactions