Remove unnecessary case (it is handled by function code path)

This commit is contained in:
Dan Abramov
2018-11-23 13:55:23 +00:00
parent 08776d7452
commit f613134659
+2 -15
View File
@@ -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,