Closed oertels closed 5 years ago
In this case, you probably need to add a type in createGlobalState. (as the useGlobalState type is inferred from it.)
type State = {
user: IUser | null;
};
const { GlobalStateProvider, useGlobalState } = createGlobalState<State>(initialState);
Thanks, got it working that way.
Hi, a question: I would like to initialize a value with
null
, something likeI get an error:
Is there any workaround?
Thanks!