import type React from 'react'; export function isComponent( component?: React.ComponentType | React.ForwardRefExoticComponent ): component is React.ComponentType { return typeof component === 'function'; } export function isForwardRefExoticComponent( component: React.ComponentType | React.ForwardRefExoticComponent ): component is React.ForwardRefExoticComponent { return ( typeof component === 'object' && typeof (component as React.ForwardRefExoticComponent).$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes( (component as React.ForwardRefExoticComponent).$$typeof.description! ) ); }