on-internet
← Community

How do I force a page reload on Hooks state change?

Stack Overflow ·

I'm using react hooks and need to do a page refresh on state change. I tried using window.location.reload() but this doesn't result in a proper refresh. const responseGoogle = async googleData => { await userLogin(googleData); setLoggedIn(true); window.location.reload() }; Only a manual F5 refresh does the job! Is there anything that's like a full refresh in React? Any help is much appreciated.

Comments

Sign in or sign up to comment and upvote.

No comments yet.