UNPKG

@modular-forms/react

Version:

The modular and type-safe form library for React

11 lines (10 loc) 428 B
import type { FieldArrayPath, FieldPath, FieldValues } from '../types'; /** * Returns the index of the path in the field array. * * @param name The name of the field array. * @param path The path to get the index from. * * @returns The field index in the array. */ export declare function getPathIndex<TFieldValues extends FieldValues>(name: string, path: FieldPath<TFieldValues> | FieldArrayPath<TFieldValues>): number;