@atlaskit/form
Version:
A form allows people to input information.
11 lines (10 loc) • 666 B
TypeScript
import { type FormState, type FormSubscription } from 'final-form';
/**
* A hook to return a recent form state for use within the `<Form>` as it requires context access.
* This is useful for previewing form state, or for building custom fields that need to react to form state.
*
* This should not be used as a way to persist form state into another form state, use `onSubmit` for proper form handling.
*
* @note On the initial render, this should be `undefined` as our form has not provided any state.
*/
export declare const useFormState: <FormValues extends Record<string, any>>(subscriptionConfig?: FormSubscription) => FormState<FormValues> | undefined;