File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ const useAJVForm = <T extends Record<string, any>>(
136
136
return { isValid : false , data : null } ;
137
137
}
138
138
139
- if ( ! isFormValid ( state , initialStateRef . current ) ) {
139
+ if ( ! isFormValid ( state ) ) {
140
140
return { isValid : false , data : null } ;
141
141
}
142
142
@@ -155,21 +155,16 @@ const useAJVForm = <T extends Record<string, any>>(
155
155
) ;
156
156
} ;
157
157
158
- const isFormValid = (
159
- currentState : IState < T > ,
160
- initialState : IState < T > ,
161
- ) : boolean => {
158
+ const isFormValid = ( currentState : IState < T > ) : boolean => {
162
159
const hasErrors = Object . keys ( currentState ) . some (
163
160
( key ) => currentState [ key ] . error !== '' ,
164
161
) ;
165
162
166
- const formIsDirty = isFormDirty ( currentState , initialState ) ;
167
-
168
- return ! hasErrors && formIsDirty ;
163
+ return ! hasErrors ;
169
164
} ;
170
165
171
166
const isValid = useMemo ( ( ) => {
172
- return isFormValid ( state , initialStateRef . current ) ;
167
+ return isFormValid ( state ) ;
173
168
} , [ state ] ) ;
174
169
175
170
const isDirty = useMemo (
You can’t perform that action at this time.
0 commit comments