@@ -30,6 +30,7 @@ import {
30
30
} from './utils/valueUtil' ;
31
31
32
32
const EMPTY_ERRORS : any [ ] = [ ] ;
33
+ const EMPTY_WARNINGS : any [ ] = [ ] ;
33
34
34
35
export type ShouldUpdate < Values = any > =
35
36
| boolean
@@ -146,7 +147,7 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
146
147
private prevValidating : boolean ;
147
148
148
149
private errors : string [ ] = EMPTY_ERRORS ;
149
- private warnings : string [ ] = EMPTY_ERRORS ;
150
+ private warnings : string [ ] = EMPTY_WARNINGS ;
150
151
151
152
// ============================== Subscriptions ==============================
152
153
constructor ( props : InternalFieldProps ) {
@@ -268,7 +269,7 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
268
269
this . dirty = true ;
269
270
this . validatePromise = null ;
270
271
this . errors = EMPTY_ERRORS ;
271
- this . warnings = EMPTY_ERRORS ;
272
+ this . warnings = EMPTY_WARNINGS ;
272
273
this . triggerMetaEvent ( ) ;
273
274
}
274
275
@@ -280,7 +281,7 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
280
281
this . dirty = false ;
281
282
this . validatePromise = undefined ;
282
283
this . errors = EMPTY_ERRORS ;
283
- this . warnings = EMPTY_ERRORS ;
284
+ this . warnings = EMPTY_WARNINGS ;
284
285
this . triggerMetaEvent ( ) ;
285
286
286
287
onReset ?.( ) ;
@@ -320,7 +321,7 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
320
321
this . errors = data . errors || EMPTY_ERRORS ;
321
322
}
322
323
if ( 'warnings' in data ) {
323
- this . warnings = data . warnings || EMPTY_ERRORS ;
324
+ this . warnings = data . warnings || EMPTY_WARNINGS ;
324
325
}
325
326
this . dirty = true ;
326
327
@@ -474,7 +475,7 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
474
475
this . validatePromise = rootPromise ;
475
476
this . dirty = true ;
476
477
this . errors = EMPTY_ERRORS ;
477
- this . warnings = EMPTY_ERRORS ;
478
+ this . warnings = EMPTY_WARNINGS ;
478
479
this . triggerMetaEvent ( ) ;
479
480
480
481
// Force trigger re-render since we need sync renderProps with new meta
0 commit comments