MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / isForwardOrMemoForward

Function isForwardOrMemoForward

packages/utils/src/is-react.ts:43–53  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

41}
42
43export function isForwardOrMemoForward(obj: any): boolean {
44 if (!obj || !obj?.$$typeof) {
45 return false;
46 }
47 return (
48 // React.forwardRef(..)
49 isForwardRefType(obj) ||
50 // React.memo(React.forwardRef(..))
51 (isMemoType(obj) && isForwardRefType(obj.type))
52 );
53}
54
55export function isReactComponent(obj: any): obj is ComponentType<any> {
56 if (!obj) {

Callers 2

is-react.test.tsxFile · 0.90
acceptsRefFunction · 0.85

Calls 2

isForwardRefTypeFunction · 0.85
isMemoTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…