@@ -134,7 +134,7 @@ const useArrayTableSources = () => {
134
134
135
135
return parseArrayItems ( schema . items )
136
136
}
137
- const indexKey = '__index__ '
137
+ const indexKey = '__DO_NOT_USE_THIS_PROPERTY_index__ '
138
138
const useArrayTableColumns = (
139
139
dataSource : any [ ] ,
140
140
field : ArrayField ,
@@ -152,7 +152,7 @@ const useArrayTableColumns = (
152
152
const index = record [ indexKey ]
153
153
154
154
const children = (
155
- < ArrayBase . Item index = { index } record = { record } >
155
+ < ArrayBase . Item index = { index } record = { ( ) => field ?. value ?. [ index ] } >
156
156
< RecursionField
157
157
schema = { schema }
158
158
name = { index }
@@ -342,9 +342,10 @@ const InternalArrayTable: ReactFC<TableProps<any>> = observer(
342
342
const field = useField < ArrayField > ( )
343
343
const prefixCls = usePrefixCls ( 'formily-array-table' )
344
344
const [ wrapSSR , hashId ] = useStyle ( prefixCls )
345
- const dataSource = Array . isArray ( field . value )
346
- ? field . value . slice ( ) . map ( ( x , idx ) => ( { [ indexKey ] : idx , ...x } ) )
347
- : [ ]
345
+ const dataSource = Array . isArray ( field . value ) ? field . value . slice ( ) : [ ]
346
+ dataSource . forEach ( ( item , index ) => {
347
+ item [ indexKey ] = index
348
+ } )
348
349
const sources = useArrayTableSources ( )
349
350
const columns = useArrayTableColumns ( dataSource , field , sources )
350
351
const pagination = isBool ( props . pagination ) ? { } : props . pagination
0 commit comments