Skip to content

Commit e80d904

Browse files
committed
fix failing test "selector is not called when snaphot has not changed"
1 parent e6ed8ab commit e80d904

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/use-sync-external-store/src/useSyncExternalStoreWithSelector.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
9393
// to React that the selections are conceptually equal, and we can bail
9494
// out of rendering.
9595
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
96+
memoizedSnapshot = nextSnapshot;
9697
return prevSelection;
9798
}
9899

0 commit comments

Comments
 (0)