diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 76f93beac08..ce93bccfdd6 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -417,7 +417,7 @@ export default function( if (updateQueue !== null) { const nextProps = workInProgress.pendingProps; const prevState = workInProgress.memoizedState; - const prevChildren = prevState !== null ? prevState.children : null; + const prevChildren = prevState !== null ? prevState.element : null; processUpdateQueue( workInProgress, updateQueue, @@ -426,7 +426,9 @@ export default function( renderExpirationTime, ); const nextState = workInProgress.memoizedState; - const nextChildren = nextState.children; + // Caution: React DevTools currently depends on this property + // being called "element". + const nextChildren = nextState.element; if (nextChildren === prevChildren) { // If the state is the same as before, that's a bailout because we had diff --git a/packages/react-reconciler/src/ReactFiberReconciler.js b/packages/react-reconciler/src/ReactFiberReconciler.js index 519003f1771..a3f38bc3942 100644 --- a/packages/react-reconciler/src/ReactFiberReconciler.js +++ b/packages/react-reconciler/src/ReactFiberReconciler.js @@ -340,7 +340,9 @@ export default function( } const update = createUpdate(expirationTime); - update.payload = {children: element}; + // Caution: React DevTools currently depends on this property + // being called "element". + update.payload = {element}; callback = callback === undefined ? null : callback; if (callback !== null) { diff --git a/packages/react-reconciler/src/ReactFiberUnwindWork.js b/packages/react-reconciler/src/ReactFiberUnwindWork.js index e59324c3c42..05a8a1856d0 100644 --- a/packages/react-reconciler/src/ReactFiberUnwindWork.js +++ b/packages/react-reconciler/src/ReactFiberUnwindWork.js @@ -67,7 +67,9 @@ export default function( const update = createUpdate(expirationTime); // Unmount the root by rendering null. update.tag = CaptureUpdate; - update.payload = {children: null}; + // Caution: React DevTools currently depends on this property + // being called "element". + update.payload = {element: null}; const error = errorInfo.value; update.callback = () => { onUncaughtError(error);