diff --git a/src/utils.js b/src/utils.js index 58d29ff..bd40169 100755 --- a/src/utils.js +++ b/src/utils.js @@ -237,8 +237,20 @@ function isFunctionComponent(component) { return typeof component === 'function' } +function isExoticComponent(component) { + return ( + typeof component === 'object' && + typeof component.$$typeof === 'symbol' && + ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description) + ) +} + function isReactComponent(component) { - return isClassComponent(component) || isFunctionComponent(component) + return ( + isClassComponent(component) || + isFunctionComponent(component) || + isExoticComponent(component) + ) } export function isFunction(a) {