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
Your example code shows how to subscribe to context variables
e.g.
const Counter2 = () => {
const count2 = useContextSelector(context, v => v[0].count2);
const setState = useContextSelector(context, v => v[1]);
How do I subscribe to the entire context using useContextSelector if i initialise my context with your CreateContext method?
React's useContext doesnt work if i use your createContext method to initialise context and I cant find documentation/code to subscribe to everything on the context and not just individual properties or state slices.
Thanks
The text was updated successfully, but these errors were encountered:
laurencefass
changed the title
How do you subscribe to entire context to replicate original useContext?
How do you subscribe to entire context to replicate React.useContext?
Jan 18, 2022
Your example code shows how to subscribe to context variables
e.g.
How do I subscribe to the entire context using useContextSelector if i initialise my context with your CreateContext method?
React's useContext doesnt work if i use your createContext method to initialise context and I cant find documentation/code to subscribe to everything on the context and not just individual properties or state slices.
Thanks
The text was updated successfully, but these errors were encountered: