UNPKG

fielder

Version:

A field-first form library for React and React Native

15 lines (14 loc) 557 B
import { FieldState, FormSchemaType } from '../types'; import { ActionHandler } from './util'; /** Mounts/remounts a field to the form. */ export declare type MountFieldAction = { type: 'MOUNT_FIELD'; config: MountFieldArgs<any, any>; }; export declare type MountFieldArgs<T extends FormSchemaType, K extends keyof T> = { name: K; validate?: FieldState<T, K>['_validate']; initialValue?: FieldState<T, K>['value']; }; /** Initial and remount of field. */ export declare const doMountField: ActionHandler<MountFieldAction>;