MCPcopy
hub / github.com/untitleduico/react / isClassComponent

Function isClassComponent

utils/is-react-component.ts:17–19  ·  view source on GitHub ↗
(component: any)

Source from the content-addressed store, hash-verified

15 * Checks if a given value is a class component.
16 */
17export const isClassComponent = (component: any): component is React.ComponentClass<any, any> => {
18 return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
19};
20
21/**
22 * Checks if a given value is a forward ref component.

Callers 1

isReactComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected