MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / isComponentClass

Function isComponentClass

src/components/Authorized/Secured.jsx:10–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8const Exception403 = () => 403;
9
10export const isComponentClass = component => {
11 if (!component) return false;
12 const proto = Object.getPrototypeOf(component);
13 if (proto === React.Component || proto === Function.prototype) return true;
14 return isComponentClass(proto);
15}; // Determine whether the incoming component has been instantiated
16// AuthorizedRoute is already instantiated
17// Authorized render is already instantiated, children is no instantiated
18// Secured is not instantiated

Callers 2

PromiseRenderClass · 0.90
checkIsInstantiationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected