check() — astro Function Reference
Architecture documentation for the check() function in server-v17.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 5ae513fd_f79c_1336_3b25_46a29dc6a223["check()"] b97b7573_9108_45c6_0cb4_8a2c7176f277["server-v17.ts"] 5ae513fd_f79c_1336_3b25_46a29dc6a223 -->|defined in| b97b7573_9108_45c6_0cb4_8a2c7176f277 5c42bd5a_1c46_58fb_f634_15a2d7b7e060["renderToStaticMarkup()"] 5ae513fd_f79c_1336_3b25_46a29dc6a223 -->|calls| 5c42bd5a_1c46_58fb_f634_15a2d7b7e060 style 5ae513fd_f79c_1336_3b25_46a29dc6a223 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/integrations/react/src/server-v17.ts lines 9–37
function check(Component: any, props: Record<string, any>, children: any) {
// Note: there are packages that do some unholy things to create "components".
// Checking the $$typeof property catches most of these patterns.
if (typeof Component === 'object') {
return Component['$$typeof']?.toString().slice('Symbol('.length).startsWith('react');
}
if (typeof Component !== 'function') return false;
if (Component.name === 'QwikComponent') return false;
if (Component.prototype != null && typeof Component.prototype.render === 'function') {
return React.Component.isPrototypeOf(Component) || React.PureComponent.isPrototypeOf(Component);
}
let isReactComponent = false;
function Tester(...args: Array<any>) {
try {
const vnode = Component(...args);
if (vnode && vnode['$$typeof'] === reactTypeof) {
isReactComponent = true;
}
} catch {}
return React.createElement('div');
}
renderToStaticMarkup(Tester, props, children, {} as any);
return isReactComponent;
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does check() do?
check() is a function in the astro codebase, defined in packages/integrations/react/src/server-v17.ts.
Where is check() defined?
check() is defined in packages/integrations/react/src/server-v17.ts at line 9.
What does check() call?
check() calls 1 function(s): renderToStaticMarkup.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free