File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1696,8 +1696,11 @@ export class FormApi<
16961696 determineFormLevelErrorSourceAndValue ( {
16971697 newFormValidatorError,
16981698 isPreviousErrorFromFormValidator :
1699- currentErrorMapSource [ errorMapKey ] === 'form' ,
1700- previousErrorValue : currentErrorMap [ errorMapKey ] ,
1699+ // These conditional checks are required, otherwise we get runtime errors.
1700+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1701+ currentErrorMapSource ?. [ errorMapKey ] === 'form' ,
1702+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1703+ previousErrorValue : currentErrorMap ?. [ errorMapKey ] ,
17011704 } )
17021705
17031706 if ( newSource === 'form' ) {
@@ -1707,7 +1710,9 @@ export class FormApi<
17071710 }
17081711 }
17091712
1710- if ( currentErrorMap [ errorMapKey ] !== newErrorValue ) {
1713+ // This conditional check is required, otherwise we get runtime errors.
1714+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1715+ if ( currentErrorMap ?. [ errorMapKey ] !== newErrorValue ) {
17111716 this . setFieldMeta ( field , ( prev = defaultFieldMeta ) => ( {
17121717 ...prev ,
17131718 errorMap : {
You can’t perform that action at this time.
0 commit comments