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

Function initial

packages/core/src/reset.ts:72–78  ·  view source on GitHub ↗
(n: FormKitNode)

Source from the content-addressed store, hash-verified

70 const node = typeof id === 'string' ? getNode(id) : id
71 if (node) {
72 const initial = (n: FormKitNode) => {
73 const initial = cloneAny(n.props.initial)
74
75 if (initial !== undefined) return initial
76
77 return n.type === 'group' ? {} : n.type === 'list' ? [] : undefined
78 }
79
80 // pause all events in this tree.
81 node._e.pause(node)

Callers 1

resetFunction · 0.85

Calls 1

cloneAnyFunction · 0.90

Tested by

no test coverage detected