-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useIsAuthenticated hook doesn't cause re-render #1541
Comments
I've got the same problem. Please fix it quickly! :( |
Hey can you please elaborate what your intended behaviour is? I am sorry, but I can't understand |
I think I can explain. At least for my use case, when the auth state changes, my router redirects automatically without the need of an explicit redirect, why? because with So basically the hook isn't getting the last value automatically, you need to refresh the page to get the latest auth state. |
@imjulianeral Let's have an in-person call. |
Same problem here - can help if needed |
@darkmatter18 Sure thing! |
This is a repo which reproduces this issue. https://github.com/imjulianeral/react-auth-kit-state-bug |
Any update on this? @darkmatter18? Using |
I have the same problem. |
I don't think anything will change. It seems the current version doesn't use state so there is no state update. I draw this conclusion from this: https://github.com/react-auth-kit/react-auth-kit/issues/1558 |
@kennethhaspeel Wow, that's not what the mantainer said to me on our meet. Maybe the right move is to stick with v2. |
Hi.
it won't return you the result of you auth state, but instead it returns you function, so to fix it you should invoke it twice:
here is the fixed commit : bde86ef or just update the package and i hope it will work. Thanks. |
I have the same problem. |
The fix is coded on the master branch. Please wait for few more days for upcoming release |
Is there a temporary workaround we can use before V4 release? |
Have you tried the workaround @Odinaev444 mentioned? I'm not using this in my current project anymore (but will use it in future projects) so not sure if it works for your problem but I remember it working for me two months ago |
I also have a similar problem... |
Hello.
As in the title the useIsAuthenticated hook won't cause component's re-render.
The text was updated successfully, but these errors were encountered: