Skip to content

Commit cb43c4f

Browse files
committed
Revert "move setting memoizedSnapshot"
This reverts commit f013206.
1 parent f013206 commit cb43c4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
7676
}
7777

7878
// The snapshot has changed, so we need to compute a new selection.
79+
memoizedSnapshot = nextSnapshot;
7980
const nextSelection = selector(nextSnapshot);
8081

8182
// If a custom isEqual function is provided, use that to check if the data
@@ -86,7 +87,6 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
8687
return prevSelection;
8788
}
8889

89-
memoizedSnapshot = nextSnapshot;
9090
memoizedSelection = nextSelection;
9191
return nextSelection;
9292
};

0 commit comments

Comments
 (0)