File tree 4 files changed +9
-8
lines changed
4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 81
81
"prettier" : " ^2.2.1" ,
82
82
"react" : " ^17.0.2" ,
83
83
"react-dom" : " ^17.0.2" ,
84
- "react-hook-form" : " ^6.11.4 " ,
84
+ "react-hook-form" : " ^7.0.5 " ,
85
85
"rimraf" : " ^3.0.2" ,
86
86
"ts-jest" : " ^26.5.4" ,
87
87
"typescript" : " ^4.2.4"
88
88
},
89
89
"peerDependencies" : {
90
90
"react" : " >=16.8.0" ,
91
91
"react-dom" : " >=16.8.0" ,
92
- "react-hook-form" : " >=6.6 .0"
92
+ "react-hook-form" : " ^7.0 .0"
93
93
},
94
94
"husky" : {
95
95
"hooks" : {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const ErrorMessage = <
18
18
...rest
19
19
} : Props < TFieldErrors , TAs > ) => {
20
20
const methods = useFormContext ( ) ;
21
- const error = get ( errors || methods . errors , name ) ;
21
+ const error = get ( errors || methods . formState . errors , name ) ;
22
22
23
23
if ( ! error ) {
24
24
return null ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import {
3
- Assign ,
4
3
FieldName ,
5
4
Message ,
6
5
MultipleFieldErrors ,
7
6
FieldErrors ,
8
7
} from 'react-hook-form' ;
9
8
9
+ type Assign < T extends object , U extends object > = T & Omit < U , keyof T > ;
10
+
10
11
export type FieldValuesFromFieldErrors <
11
12
TFieldErrors
12
13
> = TFieldErrors extends FieldErrors < infer TFieldValues > ? TFieldValues : never ;
Original file line number Diff line number Diff line change @@ -5784,10 +5784,10 @@ react-dom@^17.0.2:
5784
5784
object-assign "^4.1.1"
5785
5785
scheduler "^0.20.2"
5786
5786
5787
- react-hook-form@^6.11.4 :
5788
- version "6.15 .5"
5789
- resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-6.15 .5.tgz#c2578f9ce6a6df7b33015587d40cd880dc13e2db "
5790
- integrity sha512-so2jEPYKdVk1olMo+HQ9D9n1hVzaPPFO4wsjgSeZ964R7q7CHsYRbVF0PGBi83FcycA5482WHflasdwLIUVENg ==
5787
+ react-hook-form@^7.0.5 :
5788
+ version "7.0 .5"
5789
+ resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.0 .5.tgz#33d4a437be78ca1fe86867ed937fe94b09c4bf9c "
5790
+ integrity sha512-NERg22pjSa8URYfNhDhefGVODMTP4DMLlkK+bpuN4GUWKYIh/qiV4YmPuH8bfMAcXKj+bpdh6n7dB5B6jBs74Q ==
5791
5791
5792
5792
react-is@^16.8.1 :
5793
5793
version "16.13.1"
You can’t perform that action at this time.
0 commit comments