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
Say, for example that I have a global state defined in this way. export const GLOBAL_STATE = hookstate<{ user?: User }>({ user: undefined });
And I use this state in a component like so: const state = useHookstate(GLOBAL_STATE);
When should I use state.value.user vs state.user.value vs state.user for accessing the properties of the state object? What about when using useEffect?
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
-
Say, for example that I have a global state defined in this way.
export const GLOBAL_STATE = hookstate<{ user?: User }>({ user: undefined });
And I use this state in a component like so:
const state = useHookstate(GLOBAL_STATE);
When should I use
state.value.user
vsstate.user.value
vsstate.user
for accessing the properties of the state object? What about when using useEffect?Beta Was this translation helpful? Give feedback.
All reactions