Skip to content

Commit 598c13a

Browse files
committed
Add changeset
1 parent 5376088 commit 598c13a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.changeset/full-parents-crash.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@clerk/nextjs': major
3+
'@clerk/shared': major
4+
'@clerk/react': major
5+
'@clerk/expo': major
6+
'@clerk/chrome-extension': major
7+
'@clerk/react-router': major
8+
'@clerk/clerk-js': minor
9+
'@clerk/tanstack-react-start': minor
10+
---
11+
12+
Refactor React SDK hooks to subscribe to auth state via `useSyncExternalStore`. This is a mostly internal refactor to unlock future improvements, but includes a few breaking changes and fixes.
13+
14+
Breaking changes:
15+
16+
* All `@clerk/react`-based packages: Removes ability to pass in `initialAuthState` to `useAuth`
17+
* This was added for internal use and is no longer needed
18+
* Instead pass in `initialState` to the `<ClerkProvider>`, or `dynamic` if using the Next package
19+
* See your specific SDK documentation for more information on Server Rendering
20+
* `@clerk/shared`: Removes now unused contexts `ClientContext`, `SessionContext`, `UserContext` and `OrganizationProvider`
21+
* We do not anticipate public use of these
22+
* If you were using any of these, file an issue to discuss a path forward as they are no longer available even internally
23+
24+
New features:
25+
26+
* `@clerk/clerk-js`: `addListener` now takes a `skipInitialEmit` option that can be used to avoid emitting immediately after subscribing
27+
28+
Fixes:
29+
30+
* A bug where `useAuth` would sometimes briefly return the `initialState` rather than `undefined`
31+
* This could in certain situations incorrectly lead to a brief `user: null` on the first page after signing in, indicating a signed out state
32+
* Hydration mismatches in certain rare scenarios where subtrees would suspend and hydrate only after `clerk-js` had loaded fully

0 commit comments

Comments
 (0)