Skip to content

Commit 6ac4104

Browse files
author
Brian Vaughn
committed
Fix bug introduced by double-rendering Functions using hooks
1 parent 3bf088c commit 6ac4104

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function updateForwardRef(
257257
) {
258258
// Only double-render components with Hooks
259259
if (workInProgress.memoizedState !== null) {
260-
renderWithHooks(
260+
nextChildren = renderWithHooks(
261261
current,
262262
workInProgress,
263263
render,
@@ -567,7 +567,7 @@ function updateFunctionComponent(
567567
) {
568568
// Only double-render components with Hooks
569569
if (workInProgress.memoizedState !== null) {
570-
renderWithHooks(
570+
nextChildren = renderWithHooks(
571571
current,
572572
workInProgress,
573573
Component,
@@ -1252,7 +1252,7 @@ function mountIndeterminateComponent(
12521252
) {
12531253
// Only double-render components with Hooks
12541254
if (workInProgress.memoizedState !== null) {
1255-
renderWithHooks(
1255+
value = renderWithHooks(
12561256
null,
12571257
workInProgress,
12581258
Component,

0 commit comments

Comments
 (0)