Skip to content

Commit

Permalink
Revert "move setting memoizedSnapshot"
Browse files Browse the repository at this point in the history
This reverts commit f013206.
  • Loading branch information
dai-shi committed Oct 4, 2021
1 parent f013206 commit cb43c4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -86,7 +87,6 @@ export function useSyncExternalStoreExtra<Snapshot, Selection>(
return prevSelection;
}

memoizedSnapshot = nextSnapshot;
memoizedSelection = nextSelection;
return nextSelection;
};
Expand Down

0 comments on commit cb43c4f

Please sign in to comment.