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
I found this library by looking for a way to enhance/improve the functionality of React.Context
So I have some questions about what not to do, best practice usage, etc.
Is there a performance issue if I implement "helper" hooks similar to these:
Is there any performance issue if I setup/access state and dispatch in "Object" instead of a "Tuple" ?
exportconstcontext=createContext<{state: State,dispatch: Dispatch}>({state: initialState,dispatch: ()=>null});// then in component constresource=useContextSelector(context,(v)=>v.state.resource);constdispatch=useContextSelector(context,(v)=>v.dispatch);// this may also be combined with the code on top about `useMainStore()`
The text was updated successfully, but these errors were encountered:
This library exists as an internal library for React-Tracked and has been maintained. Its purpose is to make it compatible with Concurrent Rendering, but it's not often the capability people need.
Question
I found this library by looking for a way to enhance/improve the functionality of
React.Context
So I have some questions about what not to do, best practice usage, etc.
state
anddispatch
in "Object" instead of a "Tuple" ?The text was updated successfully, but these errors were encountered: