Skip to main content

renderComponent

Appropriately renders ReactNode, component types, or component instances. Handles different input types and returns the appropriate rendered output.

Signature

const renderComponent: <P extends object>(Component: ReactComponent<P>, props?: P) => ReactNode

Parameters

NameTypeDescription
Component-The ReactNode or component to render
props-Props to pass to the component

Returns

The rendered ReactNode or null