MCPcopy Create free account
hub / github.com/formkit/formkit / isComponent

Function isComponent

packages/react/src/composables/createInput.ts:12–21  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

10let totalCreated = 1
11
12function isComponent(obj: any): obj is ComponentType<any> {
13 return (
14 typeof obj === 'function' ||
15 (typeof obj === 'object' &&
16 !Array.isArray(obj) &&
17 !('$el' in obj) &&
18 !('$cmp' in obj) &&
19 !('if' in obj))
20 )
21}
22
23export function createInput<V = unknown>(
24 schemaOrComponent: FormKitSchemaNode | FormKitSection | ComponentType<any>,

Callers 1

createInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected