clean-aquamarineC
Refine2y ago
40 replies
clean-aquamarine

Infinite rerenders useIsAuthenticated inside of Authenticated component

In the following thread this is addressed: https://discord-questions.refine.dev/m/1189348609368531035
There were no updates on any fixes, the problem is still happening and requires for components that call useIsAuthenticated to not live inside of authenticated routes, which requires work-arounds for some logic.
The current docs also only state the usage of checking the isAuthenticated context within public pages, but this may also be relevant for authenticated pages; https://refine.dev/docs/authentication/hooks/use-is-authenticated/
I had a v3 app with a very simple, custom auth provider. Things were working. I migrated to v4 (just created a new project and started porting code over). I scaffolded it from the refine install. It created a sample authProvider. But when I swapped in my revised custom auth provider, the app became unresponsive. Eventually traced it to useIsAuth...
useIsAuthenticated infinite re-renders - Refine
useIsAuthenticated data hook from Refine is a modified version of react-query's useMutation for create mutations
useIsAuthenticated | Refine
Was this page helpful?