React Typescript useContext

Please who's got a better ideal on how to solve this problem with React && Typescript useContext() ?
2 Replies
Coder_Carl
Coder_Carl3y ago
inside of your createContext of null which can only be null change it to:
export const Context = createContext({} as ContextProps)
Context.displayName = "Login Context";
export const Context = createContext({} as ContextProps)
Context.displayName = "Login Context";
Leke
LekeOP3y ago
Thank you The error is gone
Want results from more Discord servers?
Add your server