Partial RN sync

Summary:
This cherry-picks one commit: https://github.com/facebook/react/commit/01fb68b9bf680ab8bbf96e86501e0fc540b3cc97

It fixes a bug in Fast Refresh.

Reviewed By: threepointone

Differential Revision: D17140543

fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22
This commit is contained in:
Dan Abramov
2019-09-04 17:20:31 +02:00
committed by grabbou
parent c0fa590a03
commit eb0216d8be
4 changed files with 20 additions and 0 deletions
@@ -11122,6 +11122,11 @@ function renderWithHooks(
do {
didScheduleRenderPhaseUpdate = false;
numberOfReRenders += 1;
{
// Even when hot reloading, allow dependencies to stabilize
// after first render to prevent infinite render phase updates.
ignorePreviousDependencies = false;
}
// Start over from the beginning of the list
nextCurrentHook = current !== null ? current.memoizedState : null;
@@ -11118,6 +11118,11 @@ function renderWithHooks(
do {
didScheduleRenderPhaseUpdate = false;
numberOfReRenders += 1;
{
// Even when hot reloading, allow dependencies to stabilize
// after first render to prevent infinite render phase updates.
ignorePreviousDependencies = false;
}
// Start over from the beginning of the list
nextCurrentHook = current !== null ? current.memoizedState : null;
@@ -10699,6 +10699,11 @@ function renderWithHooks(
do {
didScheduleRenderPhaseUpdate = false;
numberOfReRenders += 1;
{
// Even when hot reloading, allow dependencies to stabilize
// after first render to prevent infinite render phase updates.
ignorePreviousDependencies = false;
}
// Start over from the beginning of the list
nextCurrentHook = current !== null ? current.memoizedState : null;
@@ -10695,6 +10695,11 @@ function renderWithHooks(
do {
didScheduleRenderPhaseUpdate = false;
numberOfReRenders += 1;
{
// Even when hot reloading, allow dependencies to stabilize
// after first render to prevent infinite render phase updates.
ignorePreviousDependencies = false;
}
// Start over from the beginning of the list
nextCurrentHook = current !== null ? current.memoizedState : null;