-
Notifications
You must be signed in to change notification settings - Fork 407
fix(clerk-react): Use derived state over local state in useAuth #4715
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
Conversation
🦋 Changeset detectedLatest commit: db73c18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
!snapshot |
|
Hey @jacekradko - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.5.3-snapshot.v20241204220050 --save-exact
npm i @clerk/backend@1.19.1-snapshot.v20241204220050 --save-exact
npm i @clerk/chrome-extension@2.0.4-snapshot.v20241204220050 --save-exact
npm i @clerk/clerk-js@5.38.0-snapshot.v20241204220050 --save-exact
npm i @clerk/elements@0.20.1-snapshot.v20241204220050 --save-exact
npm i @clerk/clerk-expo@2.4.0-snapshot.v20241204220050 --save-exact
npm i @clerk/expo-passkeys@0.0.12-snapshot.v20241204220050 --save-exact
npm i @clerk/express@1.3.21-snapshot.v20241204220050 --save-exact
npm i @clerk/fastify@2.0.23-snapshot.v20241204220050 --save-exact
npm i @clerk/localizations@3.7.3-snapshot.v20241204220050 --save-exact
npm i @clerk/nextjs@6.7.0-snapshot.v20241204220050 --save-exact
npm i @clerk/nuxt@0.0.8-snapshot.v20241204220050 --save-exact
npm i @clerk/clerk-react@5.18.1-snapshot.v20241204220050 --save-exact
npm i @clerk/remix@4.3.1-snapshot.v20241204220050 --save-exact
npm i @clerk/clerk-sdk-node@5.0.72-snapshot.v20241204220050 --save-exact
npm i @clerk/shared@2.18.1-snapshot.v20241204220050 --save-exact
npm i @clerk/tanstack-start@0.6.1-snapshot.v20241204220050 --save-exact
npm i @clerk/testing@1.3.33-snapshot.v20241204220050 --save-exact
npm i @clerk/themes@2.1.51-snapshot.v20241204220050 --save-exact
npm i @clerk/types@4.37.0-snapshot.v20241204220050 --save-exact
npm i @clerk/ui@0.1.28-snapshot.v20241204220050 --save-exact
npm i @clerk/vue@0.0.12-snapshot.v20241204220050 --save-exact |
|
!snapshot |
|
Hey @jacekradko - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.5.5-snapshot.v20241206011518 --save-exact
npm i @clerk/backend@1.20.0-snapshot.v20241206011518 --save-exact
npm i @clerk/chrome-extension@2.0.6-snapshot.v20241206011518 --save-exact
npm i @clerk/clerk-js@5.40.0-snapshot.v20241206011518 --save-exact
npm i @clerk/elements@0.21.1-snapshot.v20241206011518 --save-exact
npm i @clerk/clerk-expo@2.4.2-snapshot.v20241206011518 --save-exact
npm i @clerk/expo-passkeys@0.0.14-snapshot.v20241206011518 --save-exact
npm i @clerk/express@1.3.23-snapshot.v20241206011518 --save-exact
npm i @clerk/fastify@2.0.25-snapshot.v20241206011518 --save-exact
npm i @clerk/localizations@3.8.0-snapshot.v20241206011518 --save-exact
npm i @clerk/nextjs@6.8.0-snapshot.v20241206011518 --save-exact
npm i @clerk/nuxt@0.0.10-snapshot.v20241206011518 --save-exact
npm i @clerk/clerk-react@5.19.0-snapshot.v20241206011518 --save-exact
npm i @clerk/remix@4.3.3-snapshot.v20241206011518 --save-exact
npm i @clerk/clerk-sdk-node@5.0.74-snapshot.v20241206011518 --save-exact
npm i @clerk/shared@2.19.1-snapshot.v20241206011518 --save-exact
npm i @clerk/tanstack-start@0.6.3-snapshot.v20241206011518 --save-exact
npm i @clerk/testing@1.3.35-snapshot.v20241206011518 --save-exact
npm i @clerk/themes@2.1.53-snapshot.v20241206011518 --save-exact
npm i @clerk/types@4.39.0-snapshot.v20241206011518 --save-exact
npm i @clerk/ui@0.2.1-snapshot.v20241206011518 --save-exact
npm i @clerk/vue@0.0.14-snapshot.v20241206011518 --save-exact |
Description
The
useAuthhook was capturing Auth context in local state, which could become out of sync with the actual Auth state and causing additional re-renders. Now theuseAuthhook derives it's state directly from Auth context.Thanks @brkalow for the context and the fix
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change