@@ -7,20 +7,6 @@ import isIterable from './isIterable';
77import parseStyleName from './parseStyleName' ;
88import generateAppendClassName from './generateAppendClassName' ;
99
10- const mapChildrenWithoutKeyPrefix = ( children : ReactElement , mapper : Function , context : Object ) => {
11- if ( typeof children === 'undefined' || children === null ) {
12- return children ;
13- }
14-
15- const result = [ ] ;
16-
17- React . Children . forEach ( children , ( child , index ) => {
18- result . push ( mapper . call ( context , child , index ) ) ;
19- } ) ;
20-
21- return result ;
22- } ;
23-
2410const linkArray = ( array : Array , styles : Object , configuration : Object ) => {
2511 _ . forEach ( array , ( value , index ) => {
2612 if ( React . isValidElement ( value ) ) {
@@ -55,7 +41,7 @@ const linkElement = (element: ReactElement, styles: Object, configuration: Objec
5541 if ( React . isValidElement ( children ) ) {
5642 elementShallowCopy . props . children = linkElement ( React . Children . only ( children ) , styles , configuration ) ;
5743 } else if ( _ . isArray ( children ) || isIterable ( children ) ) {
58- elementShallowCopy . props . children = mapChildrenWithoutKeyPrefix ( children , ( node ) => {
44+ elementShallowCopy . props . children = React . Children . map ( children , ( node ) => {
5945 if ( React . isValidElement ( node ) ) {
6046 // eslint-disable-next-line no-use-before-define
6147 return linkElement ( React . Children . only ( node ) , styles , configuration ) ;
0 commit comments