File tree Expand file tree Collapse file tree
packages/rcre/src/core/Layout/ForEach Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import {BasicConfig, BasicProps} from '../../../types';
44import { IteratorContext } from '../../context' ;
55import { componentLoader } from '../../util/componentLoader' ;
66import { createChild } from '../../util/createChild' ;
7+ import { setWith } from '../../util/util' ;
78
89export interface ForeachProps extends BasicProps {
910 /**
@@ -52,8 +53,8 @@ export class Foreach extends React.PureComponent<ForeachProps, {}> {
5253 {
5354 iteratorContext => {
5455 if ( iteratorContext . $item && iteratorContext . hasOwnProperty ( '$index' ) ) {
55- source [ '$parentItem' ] = iteratorContext . $item ;
56- source [ '$parentIndex' ] = iteratorContext . $index ;
56+ source = setWith ( source , '$parentItem' , iteratorContext . $item ) ;
57+ source = setWith ( source , '$parentIndex' , iteratorContext . $index ) ;
5758 }
5859
5960 return (
You can’t perform that action at this time.
0 commit comments