From f613134659eb5e1853a54e23246db0c4bf37b04a Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 23 Nov 2018 13:55:23 +0000 Subject: [PATCH] Remove unnecessary case (it is handled by function code path) --- .../react-reconciler/src/ReactFiberBeginWork.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 78ef996861..8f1e8d971a 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -386,12 +386,13 @@ function updateSimpleMemoComponent( if (outerPropTypes) { checkPropTypes( outerPropTypes, - nextProps, // Resolved (we know there's no defaultProps) + nextProps, // Resolved (SimpleMemoComponent has no defaultProps) 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev, ); } + // Inner propTypes will be validated in the function component path. } } if (current !== null && updateExpirationTime < renderExpirationTime) { @@ -407,20 +408,6 @@ function updateSimpleMemoComponent( ); } } - if (__DEV__) { - // Inner memo component props aren't currently validated in createElement. - // We could move it there, but we'd still need this for lazy code path. - const innerPropTypes = Component.propTypes; - if (innerPropTypes) { - checkPropTypes( - innerPropTypes, - nextProps, // Resolved props - 'prop', - getComponentName(Component), - getCurrentFiberStackInDev, - ); - } - } return updateFunctionComponent( current, workInProgress,