Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
33
node_modules/react-hook-form/dist/useFormState.d.ts
generated
vendored
Normal file
33
node_modules/react-hook-form/dist/useFormState.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import type { FieldValues, UseFormStateProps, UseFormStateReturn } from './types';
|
||||
/**
|
||||
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
||||
*
|
||||
* @remarks
|
||||
* [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)
|
||||
*
|
||||
* @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
* function App() {
|
||||
* const { register, handleSubmit, control } = useForm({
|
||||
* defaultValues: {
|
||||
* firstName: "firstName"
|
||||
* }});
|
||||
* const { dirtyFields } = useFormState({
|
||||
* control
|
||||
* });
|
||||
* const onSubmit = (data) => console.log(data);
|
||||
*
|
||||
* return (
|
||||
* <form onSubmit={handleSubmit(onSubmit)}>
|
||||
* <input {...register("firstName")} placeholder="First Name" />
|
||||
* {dirtyFields.firstName && <p>Field is dirty.</p>}
|
||||
* <input type="submit" />
|
||||
* </form>
|
||||
* );
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export declare function useFormState<TFieldValues extends FieldValues = FieldValues, TTransformedValues = TFieldValues>(props?: UseFormStateProps<TFieldValues, TTransformedValues>): UseFormStateReturn<TFieldValues>;
|
||||
//# sourceMappingURL=useFormState.d.ts.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue