-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue with
useSelector
always computing fresh snapshots in…
…ternally for uninitialized services (#3500) * Fixed an issue with `useSelector` always computing fresh snapshots internally for uninitialized services * Update packages/xstate-react/src/useSelector.ts Co-authored-by: David Khourshid <davidkpiano@gmail.com> Co-authored-by: David Khourshid <davidkpiano@gmail.com>
- Loading branch information
1 parent
a6c9b6d
commit 0dfc6d9
Showing
3 changed files
with
63 additions
and
13 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,5 @@ | ||
--- | ||
'@xstate/react': patch | ||
--- | ||
|
||
Fixed an issue with `useSelector` always computing fresh snapshots internally for uninitialized services. This avoids the internal `useSyncExternalStore` from warning about the snapshot value not being cached properly. |
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