@@ -7,20 +7,6 @@ import isIterable from './isIterable';
7
7
import parseStyleName from './parseStyleName' ;
8
8
import generateAppendClassName from './generateAppendClassName' ;
9
9
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
-
24
10
const linkArray = ( array : Array , styles : Object , configuration : Object ) => {
25
11
_ . forEach ( array , ( value , index ) => {
26
12
if ( React . isValidElement ( value ) ) {
@@ -55,7 +41,7 @@ const linkElement = (element: ReactElement, styles: Object, configuration: Objec
55
41
if ( React . isValidElement ( children ) ) {
56
42
elementShallowCopy . props . children = linkElement ( React . Children . only ( children ) , styles , configuration ) ;
57
43
} else if ( _ . isArray ( children ) || isIterable ( children ) ) {
58
- elementShallowCopy . props . children = mapChildrenWithoutKeyPrefix ( children , ( node ) => {
44
+ elementShallowCopy . props . children = React . Children . map ( children , ( node ) => {
59
45
if ( React . isValidElement ( node ) ) {
60
46
// eslint-disable-next-line no-use-before-define
61
47
return linkElement ( React . Children . only ( node ) , styles , configuration ) ;
0 commit comments