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.
  • Loading branch information
mistercrunch authored and betodealmeida committed Sep 16, 2018
1 parent b68766d commit 9c486a3
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 9c486a3

Please sign in to comment.