react-hook-form 7.0.0-rc.8 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +20 -19
- package/dist/controller.d.ts +1 -1
- package/dist/index.cjs.development.js +933 -923
- package/dist/index.cjs.development.js.map +1 -1
- package/dist/index.cjs.production.min.js +1 -1
- package/dist/index.cjs.production.min.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.esm.js +933 -923
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.development.js +933 -923
- package/dist/index.umd.development.js.map +1 -1
- package/dist/index.umd.production.min.js +1 -1
- package/dist/index.umd.production.min.js.map +1 -1
- package/dist/logic/appendErrors.d.ts +1 -1
- package/dist/logic/getValidateError.d.ts +1 -1
- package/dist/logic/isErrorStateChanged.d.ts +1 -1
- package/dist/types/controller.d.ts +12 -12
- package/dist/types/errors.d.ts +2 -2
- package/dist/types/fieldArray.d.ts +1 -1
- package/dist/types/form.d.ts +6 -6
- package/dist/types/index.d.ts +5 -5
- package/dist/types/resolvers.d.ts +2 -2
- package/dist/useController.d.ts +2 -2
- package/dist/useForm.d.ts +1 -1
- package/dist/useFormContext.d.ts +2 -1
- package/dist/useFormState.d.ts +2 -2
- package/dist/useWatch.d.ts +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [7.0.0-rc.7] - 2021-03-28
|
4
|
+
|
5
|
+
### Changes
|
6
|
+
|
7
|
+
- change type name from `RefCallbackHandler` to `UseFormRegisterReturn` for register callback's return
|
8
|
+
|
3
9
|
## [7.0.0-rc.7] - 2021-03-23
|
4
10
|
|
5
|
-
|
11
|
+
### Changes
|
6
12
|
|
7
13
|
- `useFieldArray` will produce an empty array `[]` when no field is presented.
|
8
14
|
|
package/README.md
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
<div align="center">
|
2
2
|
<p align="center">
|
3
3
|
<a href="https://react-hook-form.com" title="React Hook Form - Simple React forms validation">
|
4
|
-
<img src="https://raw.githubusercontent.com/
|
4
|
+
<img src="https://raw.githubusercontent.com/react-hook-form/react-hook-form/master/docs/logo.png" alt="React Hook Form Logo - React hook custom hook for form validation" />
|
5
5
|
</a>
|
6
6
|
</p>
|
7
7
|
</div>
|
8
8
|
|
9
|
-
<
|
9
|
+
<div align="center">
|
10
|
+
<p align="center">
|
11
|
+
<a href="https://react-hook-form.com" title="React Hook Form - Simple React forms validation">
|
12
|
+
<img src="https://raw.githubusercontent.com/bluebill1049/react-hook-form/master/docs/v7_example.gif" alt="React Hook Form video - React custom hook for form validation" width="100%" />
|
13
|
+
</a>
|
14
|
+
</p>
|
15
|
+
</div>
|
10
16
|
|
11
17
|
<div align="center">
|
12
18
|
|
@@ -17,24 +23,16 @@
|
|
17
23
|
|
18
24
|
</div>
|
19
25
|
|
20
|
-
<div align="center">
|
21
|
-
<p align="center">
|
22
|
-
<a href="https://react-hook-form.com" title="React Hook Form - Simple React forms validation">
|
23
|
-
<img src="https://raw.githubusercontent.com/bluebill1049/react-hook-form/master/docs/v7_example.gif" alt="React Hook Form video - React custom hook for form validation" width="100%" />
|
24
|
-
</a>
|
25
|
-
</p>
|
26
|
-
</div>
|
27
|
-
|
28
26
|
Version 7 | [Version 6](/docs/README.V6.md)
|
29
27
|
|
30
28
|
## Features
|
31
29
|
|
32
30
|
- Built with performance and DX in mind
|
33
|
-
-
|
34
|
-
-
|
35
|
-
- [
|
31
|
+
- Embraces native form validation
|
32
|
+
- Out of the box integration with [UI libraries](https://codesandbox.io/s/react-hook-form-v7-controller-5h1q5)
|
33
|
+
- [Small size](https://bundlephobia.com/result?p=react-hook-form@latest) and no [dependencies](./package.json)
|
36
34
|
- Follows HTML standard for [validation](https://react-hook-form.com/get-started#Applyvalidation)
|
37
|
-
- [
|
35
|
+
- [Validation resolver](https://github.com/react-hook-form/resolvers) support for [Yup](https://github.com/jquense/yup), [Zod](https://github.com/vriad/zod), [Superstruct](https://github.com/ianstormtaylor/superstruct), [Joi](https://github.com/hapijs/joi), [Vest](https://github.com/ealush/vest) or custom
|
38
36
|
|
39
37
|
## Install
|
40
38
|
|
@@ -65,9 +63,9 @@ function App() {
|
|
65
63
|
|
66
64
|
return (
|
67
65
|
<form onSubmit={handleSubmit(onSubmit)}>
|
68
|
-
<input {...register('
|
69
|
-
<input {...register('
|
70
|
-
{errors.
|
66
|
+
<input {...register('firstName')} /> {/* register an input */}
|
67
|
+
<input {...register('lastName', { required: true })} />
|
68
|
+
{errors.lastName && <p>Last name is required.</p>}
|
71
69
|
<input {...register('age', { pattern: /\d+/ })} />
|
72
70
|
{errors.age && <p>Please enter number for age.</p>}
|
73
71
|
<input type="submit" />
|
@@ -77,16 +75,19 @@ function App() {
|
|
77
75
|
```
|
78
76
|
|
79
77
|
<a href="https://ui.dev/bytes/?r=bill">
|
80
|
-
<img src="https://raw.githubusercontent.com/react-hook-form/react-hook-form/master/docs/ads-1.
|
78
|
+
<img src="https://raw.githubusercontent.com/react-hook-form/react-hook-form/master/docs/ads-1.jpeg" />
|
81
79
|
</a>
|
82
80
|
|
83
81
|
## Sponsors
|
84
82
|
|
85
|
-
Thanks go to these kind and lovely sponsors (
|
83
|
+
Thanks go to these kind and lovely sponsors (companies and individuals)!
|
86
84
|
|
87
85
|
<a href="https://underbelly.is/" target="_blank">
|
88
86
|
<img src="https://images.opencollective.com/underbelly/989a4a6/logo/256.png" width="94" height="94" />
|
89
87
|
</a>
|
88
|
+
<a href="https://www.leniolabs.com/" target="_blank">
|
89
|
+
<img src="https://images.opencollective.com/leniolabs_/63e9b6e/logo/256.png" width="94" height="94" />
|
90
|
+
</a>
|
90
91
|
|
91
92
|
<p>
|
92
93
|
<a href="https://github.com/sayav"
|
package/dist/controller.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ControllerProps, FieldValues } from './types';
|
3
|
-
declare const Controller: <TFieldValues extends FieldValues = FieldValues>(props: ControllerProps<TFieldValues>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
3
|
+
declare const Controller: <TFieldValues extends FieldValues = FieldValues, TName extends import("./types").Path<TFieldValues> = import("./types").Path<TFieldValues>>(props: ControllerProps<TFieldValues, TName>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
4
4
|
export { Controller };
|