form-test-victor
Version:
# Performant forms and wizard library for React
28 lines • 785 B
TypeScript
import { FieldValues } from '../../shared';
import { FormContextApi, UseFormOptions } from '../../Form';
interface UseStepFormApi {
form: FormContextApi;
initFormValues: (initialValues: FieldValues) => void;
}
/**
* Using Form in Wizard context. Data will be save and get on step change.
* @return UseStepFormApi
* @example
* ```
* const {form, initFormValues} = useStepForm()
*
* useEffect(() => {
* // If data is stored in wizard, this will not set data
* initFormValues({"foo": "foo", "bar": "bar"})
* },[]);
*
* return(
* <Form form={form}>
* <TextField name="foo" />
* </Form>
* )
* ```
*/
export declare function useStepForm(props: UseFormOptions): UseStepFormApi;
export {};
//# sourceMappingURL=useStepForm.d.ts.map