useContext(someContext) returns undefined if the component is inside fallback prop for <Show ... />
Is this normal behavior?
Usind solid-js 1.9.3 on dev env (win10).
The following renders the LoginScreen file just fine. It uses Context from Notifications.
But if i wan't to use the fallback prop for the Show component like:
Then the useContext() function is undefined. ( const { addError } = useNotifications() );
And the whole app should be wrapped inside the Provider already:
1 Reply
<Show />
's fallback expects an JSX.Element, so you want to "call" the component instead of passing it along. I am not sure if this would fix your issue, but hopefully it helps.
so turn
into