We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4bc8ae commit f013206Copy full SHA for f013206
packages/use-sync-external-store/src/useSyncExternalStoreExtra.js
@@ -76,7 +76,6 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
76
}
77
78
// The snapshot has changed, so we need to compute a new selection.
79
- memoizedSnapshot = nextSnapshot;
80
const nextSelection = selector(nextSnapshot);
81
82
// If a custom isEqual function is provided, use that to check if the data
@@ -87,6 +86,7 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
87
86
return prevSelection;
88
89
+ memoizedSnapshot = nextSnapshot;
90
memoizedSelection = nextSelection;
91
return nextSelection;
92
};
0 commit comments