diff --git a/package-lock.json b/package-lock.json index dac02961..7e9c8e2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8953,9 +8953,9 @@ } }, "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { "eventemitter3": "^4.0.0", @@ -14464,8 +14464,15 @@ "react-is": { "version": "16.13.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz", - "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==", - "dev": true + "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==" + }, + "react-keyed-flatten-children": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-keyed-flatten-children/-/react-keyed-flatten-children-1.2.0.tgz", + "integrity": "sha512-gJoD3br3tK59+AOKlzb+7G39YtkSC4gWjQjDbWOmHjW7pxgYomnRBemKXuNBafnPYSKpjp7evOlxtGEHwiP11g==", + "requires": { + "react-is": "^16.8.6" + } }, "react-test-renderer": { "version": "16.13.0", @@ -15382,8 +15389,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "resolved": "", "dev": true }, "schema-utils": { @@ -18838,8 +18844,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "resolved": "", "dev": true }, "os-locale": { diff --git a/package.json b/package.json index aa76778a..693228d5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "normalize.css": "^8.0.1", "prop-types": "^15.7.2", "react": "^16.13.1", - "react-dom": "^16.13.1" + "react-dom": "^16.13.1", + "react-keyed-flatten-children": "^1.2.0" }, "devDependencies": { "@babel/cli": "^7.8.4", diff --git a/src/lib/components/layout/CardList/CardList.jsx b/src/lib/components/layout/CardList/CardList.jsx index 8113dfb7..e46b8ebe 100644 --- a/src/lib/components/layout/CardList/CardList.jsx +++ b/src/lib/components/layout/CardList/CardList.jsx @@ -1,3 +1,4 @@ +import flattenChildren from 'react-keyed-flatten-children'; import PropTypes from 'prop-types'; import React from 'react'; import styles from './CardList.scss'; @@ -19,7 +20,7 @@ const CardList = (props) => { className={styles.root} {...other} > - {React.Children.map(children, (child) => { + {flattenChildren(children).map((child) => { if (!React.isValidElement(child)) { return null; } diff --git a/src/lib/components/layout/FormLayout/FormLayout.jsx b/src/lib/components/layout/FormLayout/FormLayout.jsx index 1812fc8c..3c32bed5 100644 --- a/src/lib/components/layout/FormLayout/FormLayout.jsx +++ b/src/lib/components/layout/FormLayout/FormLayout.jsx @@ -1,3 +1,4 @@ +import flattenChildren from 'react-keyed-flatten-children'; import PropTypes from 'prop-types'; import React from 'react'; import styles from './FormLayout.scss'; @@ -66,7 +67,7 @@ const FormLayout = (props) => { ].join(' ')} style={inlineStyle(customLabelWidth, labelAutoWidthFallback)} > - {React.Children.map(children, (child) => { + {flattenChildren(children).map((child) => { if (!React.isValidElement(child)) { return null; }