-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove useSyncExternalStore in favor of useState (#10377)
- Loading branch information
1 parent
2821817
commit 3efa5d0
Showing
8 changed files
with
38 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"react-router": patch | ||
"react-router-dom": patch | ||
--- | ||
|
||
Switched from `useSyncExternalStore` to `useState` for internal `@remix-run/router` router state syncing in `<RouterProvider>`. We found some [subtle bugs](https://codesandbox.io/s/use-sync-external-store-loop-9g7b81) where router state updates got propagated _before_ other normal `useState` updates, which could lead to footguns in `useEffect` calls. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
packages/react-router/lib/use-sync-external-store-shim/index.ts
This file was deleted.
Oops, something went wrong.
152 changes: 0 additions & 152 deletions
152
packages/react-router/lib/use-sync-external-store-shim/useSyncExternalStoreShimClient.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
packages/react-router/lib/use-sync-external-store-shim/useSyncExternalStoreShimServer.ts
This file was deleted.
Oops, something went wrong.