-
Notifications
You must be signed in to change notification settings - Fork 445
getToken changes after each render #201
Copy link
Copy link
Closed
Description
- Review the documentation: https://docs.clerk.dev/
- Search for existing issues: https://github.com/clerkinc/javascript/issues
- Go through package changelog files.
- Provide the Frontend API key from your application dashboard.
Package + Version
-
@clerk/clerk-js -
@clerk/clerk-react -
@clerk/nextjs -
@clerk/remix -
@clerk/clerk-expo -
@clerk/backend-core -
@clerk/clerk-sdk-node -
@clerk/edge - other:
Version:
^3.2.7
Browser/OS
Chrome latest
Description
We started migrating to v3 and noticed getToken from useAuth function identity is not stable and as a result changes after each re-render.
This causes the the app to go into infinite loop when getToken is used in the dependancy array of something like useEffect.
Usage Snippet:

A workaround is to remove it from the dependancy array, however that does not make eslint happy

It would be ideal if getToken can be made stable as it was in v2.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels