Skip to Content
APIFunctionsFunction: pathToString()

Hero Hook Form API v2.15.0


Hero Hook Form API / pathToString

Function: pathToString()

pathToString<T>(path): string

Defined in: types.ts:104 

Helper to convert a Path, ArrayPath, or string to a string for use in React keys and DOM operations. Path and ArrayPath are branded string types, so this is safe - it’s just removing the brand.

Type Parameters

T

T extends FieldValues

Parameters

path

The path to convert (can be Path, ArrayPath, string, or undefined)

string | Path<T> | ArrayPath<T> | undefined

Returns

string

The path as a plain string, or empty string if undefined