You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently functions references of Auth0Context.Provider are changed everytime when <Auth0Provider> renders. In that case it makes useAuth0() to return different function references and then, if they are later used in dependency arrays for other hooks (eg. useEffect), they cause them to reevaluate.
From what I see it should be safe to exclude those functions from dependencies of other hooks, but react-hooks eslint rules will still complain.
Introducing useCallback for all functions of the context value in auth0-provider.tsx should fix this.
The text was updated successfully, but these errors were encountered:
Currently functions references of
Auth0Context.Provider
are changed everytime when<Auth0Provider>
renders. In that case it makesuseAuth0()
to return different function references and then, if they are later used in dependency arrays for other hooks (eg.useEffect
), they cause them to reevaluate.From what I see it should be safe to exclude those functions from dependencies of other hooks, but react-hooks eslint rules will still complain.
Introducing
useCallback
for all functions of the context value inauth0-provider.tsx
should fix this.The text was updated successfully, but these errors were encountered: