mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
1 parent
f01320689c
commit
cb43c4fdc6
1 file changed
+1
-1
@@ -76,6 +76,7 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
|
||||
}
|
||||
|
||||
// The snapshot has changed, so we need to compute a new selection.
|
||||
memoizedSnapshot = nextSnapshot;
|
||||
const nextSelection = selector(nextSnapshot);
|
||||
|
||||
// If a custom isEqual function is provided, use that to check if the data
|
||||
@@ -86,7 +87,6 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
|
||||
return prevSelection;
|
||||
}
|
||||
|
||||
memoizedSnapshot = nextSnapshot;
|
||||
memoizedSelection = nextSelection;
|
||||
return nextSelection;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user