I'am working on med sized project and some components in react are created using a class, along with the component level state. For authentication and keeping the token within the local-storage and reloading the user from it, I would use a hook.
I regret this decision now as if you were to refresh on a class component you will lose the user and get kicked back to the login screen.
I know hooks are used for functions but is there a way to use a hook (too keep the user) inside a class?
//The hook I am using
useEffect(()=>{
auth.Context.loadUser();
//eslint-disable-next-line
},[]);