@@ -16,6 +16,7 @@ import {
16
16
REACT_ELEMENT_TYPE ,
17
17
REACT_FORWARD_REF_TYPE ,
18
18
REACT_FRAGMENT_TYPE ,
19
+ REACT_MEMO_TYPE ,
19
20
REACT_PORTAL_TYPE ,
20
21
REACT_PROFILER_TYPE ,
21
22
REACT_PROVIDER_TYPE ,
@@ -27,7 +28,6 @@ import lowPriorityWarning from 'shared/lowPriorityWarning';
27
28
export function typeOf ( object : any ) {
28
29
if ( typeof object === 'object' && object !== null ) {
29
30
const $$typeof = object . $$typeof ;
30
-
31
31
switch ( $$typeof ) {
32
32
case REACT_ELEMENT_TYPE :
33
33
const type = object . type ;
@@ -51,6 +51,7 @@ export function typeOf(object: any) {
51
51
return $$typeof ;
52
52
}
53
53
}
54
+ case REACT_MEMO_TYPE :
54
55
case REACT_PORTAL_TYPE :
55
56
return $$typeof ;
56
57
}
@@ -69,6 +70,7 @@ export const ForwardRef = REACT_FORWARD_REF_TYPE;
69
70
export const Fragment = REACT_FRAGMENT_TYPE ;
70
71
export const Profiler = REACT_PROFILER_TYPE ;
71
72
export const Portal = REACT_PORTAL_TYPE ;
73
+ export const Memo = REACT_MEMO_TYPE ;
72
74
export const StrictMode = REACT_STRICT_MODE_TYPE ;
73
75
74
76
export { isValidElementType } ;
@@ -115,6 +117,9 @@ export function isFragment(object: any) {
115
117
export function isProfiler ( object : any ) {
116
118
return typeOf ( object ) === REACT_PROFILER_TYPE ;
117
119
}
120
+ export function isMemo ( object : any ) {
121
+ return typeOf ( object ) === REACT_MEMO_TYPE ;
122
+ }
118
123
export function isPortal ( object : any ) {
119
124
return typeOf ( object ) === REACT_PORTAL_TYPE ;
120
125
}
0 commit comments