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

Function createName

packages/core/src/node.ts:1837–1840  ·  view source on GitHub ↗

* This node is responsible for deterministically generating an id for this * node. This cannot just be a random id, it _must_ be deterministic to ensure * re-hydration of the form (like post-SSR) produces the same names/ids. * * @param options - A FormKitOptions | FormKitOptions * * @r

(options: FormKitOptions)

Source from the content-addressed store, hash-verified

1835 * @internal
1836 */
1837function createName(options: FormKitOptions): string | symbol {
1838 if (options.parent?.type === 'list') return useIndex
1839 return options.name || `${options.props?.type || 'input'}_${++nameCount}`
1840}
1841
1842/**
1843 * Creates the initial value for a node based on the options passed in and the

Callers 1

createContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected