File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ export interface ListProps {
2929 operations : ListOperations ,
3030 meta : Meta ,
3131 ) => JSX . Element | React . ReactNode ;
32+
33+ /** @private Passed by Form.List props. Do not use since it will break by path check. */
34+ isListField ?: boolean ;
3235}
3336
3437const List : React . FunctionComponent < ListProps > = ( {
@@ -37,6 +40,7 @@ const List: React.FunctionComponent<ListProps> = ({
3740 children,
3841 rules,
3942 validateTrigger,
43+ isListField,
4044} ) => {
4145 const context = React . useContext ( FieldContext ) ;
4246 const keyRef = React . useRef ( {
@@ -87,6 +91,7 @@ const List: React.FunctionComponent<ListProps> = ({
8791 validateTrigger = { validateTrigger }
8892 initialValue = { initialValue }
8993 isList
94+ isListField = { isListField }
9095 >
9196 { ( { value = [ ] , onChange } , meta ) => {
9297 const { getFieldValue } = context ;
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ describe('Form.Preserve', () => {
421421 remove ( field . name ) ;
422422 } }
423423 />
424- < Form . List name = { [ field . name ] } >
424+ < Form . List { ... field } name = { [ field . name ] } >
425425 { childFields =>
426426 childFields . map ( childField => (
427427 < div key = { childField . key } >
You can’t perform that action at this time.
0 commit comments