@@ -542,7 +542,7 @@ class ReactShallowRenderer {
542
542
) ;
543
543
invariant (
544
544
isForwardRef ( element ) ||
545
- ( typeof element . type === 'function' || isMemo ( element . type ) ) ,
545
+ ( typeof element . type === 'function' || isMemo ( element ) ) ,
546
546
'ReactShallowRenderer render(): Shallow rendering works only with custom ' +
547
547
'components, but the provided element type was `%s`.' ,
548
548
Array . isArray ( element . type )
@@ -559,15 +559,15 @@ class ReactShallowRenderer {
559
559
this . _reset ( ) ;
560
560
}
561
561
562
- const elementType = isMemo(element.type ) ? element.type.type : element.type;
562
+ const elementType = isMemo(element) ? element.type.type : element.type;
563
563
const previousElement = this._element;
564
564
565
565
this._rendering = true;
566
566
this._element = element;
567
567
this._context = getMaskedContext(elementType.contextTypes, context);
568
568
569
569
// Inner memo component props aren't currently validated in createElement.
570
- if (isMemo(element.type ) && elementType . propTypes ) {
570
+ if (isMemo(element) && elementType . propTypes ) {
571
571
currentlyValidatingElement = element ;
572
572
checkPropTypes (
573
573
elementType . propTypes ,
@@ -618,7 +618,7 @@ class ReactShallowRenderer {
618
618
this._mountClassComponent(elementType, element, this._context);
619
619
} else {
620
620
let shouldRender = true ;
621
- if ( isMemo ( element . type ) && previousElement !== null ) {
621
+ if ( isMemo ( element ) && previousElement !== null ) {
622
622
// This is a Memo component that is being re-rendered.
623
623
const compare = element . type . compare || shallowEqual ;
624
624
if ( compare ( previousElement . props , element . props ) ) {
@@ -807,7 +807,7 @@ function getDisplayName(element) {
807
807
} else if (typeof element.type === 'string') {
808
808
return element . type ;
809
809
} else {
810
- const elementType = isMemo ( element . type ) ? element . type . type : element . type ;
810
+ const elementType = isMemo ( element ) ? element . type . type : element . type ;
811
811
return elementType . displayName || elementType . name || 'Unknown' ;
812
812
}
813
813
}
0 commit comments