From 4cda9d793f8cdec63c8225549886ea4b6c9f9e2a Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 16 Sep 2018 11:48:32 -0700 Subject: [PATCH] [react16] fix React type checking (#5903) Somehow checking the type of a JSX-defined React component is not straightforward and changes through versions of React. Using the `name` attr addresses the issue for now. (cherry picked from commit 9c486a3b3d5b158f48f225be22404b8bb1ae1227) --- superset/assets/src/CRUD/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/src/CRUD/utils.js b/superset/assets/src/CRUD/utils.js index 6de8c4b1653b7..3bf24e539427a 100644 --- a/superset/assets/src/CRUD/utils.js +++ b/superset/assets/src/CRUD/utils.js @@ -7,7 +7,7 @@ export function recurseReactClone(children, type, propExtender) { */ return React.Children.map(children, (child) => { let newChild = child; - if (child && child.type === type) { + if (child && child.type.name === type.name) { newChild = React.cloneElement(child, propExtender(child)); } if (newChild && newChild.props.children) {