Revert "move setting memoizedSnapshot"

This reverts commit f01320689c.
This commit is contained in:
daishi
2021-10-04 13:49:04 +09:00
parent f01320689c
commit cb43c4fdc6
@@ -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;
};