From ce5d0df59ede11c2804e39e53ef488d0d28a4c38 Mon Sep 17 00:00:00 2001 From: Leonid Nikiforenko Date: Fri, 11 Aug 2017 03:53:18 +0300 Subject: [PATCH] Avoid cloning top level arrays in props --- src/linkClass.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/linkClass.js b/src/linkClass.js index 959d599..48142e1 100644 --- a/src/linkClass.js +++ b/src/linkClass.js @@ -55,15 +55,7 @@ const linkElement = (element: ReactElement, styles: Object, configuration: Objec if (React.isValidElement(propValue)) { elementShallowCopy.props[propName] = linkElement(React.Children.only(propValue), styles, configuration); } else if (_.isArray(propValue)) { - elementShallowCopy.props[propName] = _.map(propValue, (node) => { - if (React.isValidElement(node)) { - return linkElement(React.Children.only(node), styles, configuration); - } else if (_.isArray(node)) { - return linkArray(node, styles, configuration); - } - - return node; - }); + elementShallowCopy.props[propName] = linkArray(propValue, styles, configuration); } });