Skip to content

Commit

Permalink
[react16] fix React type checking (apache#5903)
Browse files Browse the repository at this point in the history
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 9c486a3)
  • Loading branch information
mistercrunch authored and betodealmeida committed Oct 30, 2018
1 parent e05f400 commit f2bb8c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superset/assets/src/CRUD/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f2bb8c9

Please sign in to comment.