본문으로 건너뛰기

remainOnlyReactComponent

Extracts only React components from an input object and creates a new object. Filters out non-component values using component type checking.

Signature​

const remainOnlyReactComponent: <Input extends Record<string, unknown>, Output extends Record<string, ComponentType>>(dictionary: Input) => Output

Parameters​

NameTypeDescription
dictionary-An object containing React components and other values

Returns​

A new object containing only React components