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
Description
I stumbled upon issue with component preview in the app utilising ThemeProvider.
If I call preview(<MyThemedComponent />) I get Exception within useTheme.js caused by absence of context from ThemeContext
Environment
Development
Version of currently used Radon IDE
0.0.24
Version of React Native/Expo used in the project.
React Native: 0.76.2.
Expo 52.0.11
The text was updated successfully, but these errors were encountered:
Thanks @Dalamar for reporting. As discussed on discord, this apparently is expected behavior. For now, preview renders as a standalone application root, so if your components require to have a context provider installed, it need to be rendered along with the preview component.
As pointed out, it would make sense to perhaps cover some common scenarios like for example the one you posted where React Navigation context provider is used. This is something we should definitely consider.
What we'd recommend for the time being would be to create a "shell" component that'd render all context providers that are necessary to test individual components. Then in the preview call you could do:
Description
I stumbled upon issue with component preview in the app utilising ThemeProvider.
If I call
preview(<MyThemedComponent />)
I get Exception within useTheme.js caused by absence of context from ThemeContextEnvironment
Development
The text was updated successfully, but these errors were encountered: