Skip to content

Commit

Permalink
Issue 1787: Avoid caching shared events for parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustaf Lundström authored and Gustaf Lundström committed Feb 6, 2021
1 parent 9c5a212 commit 1b3c1a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/victory-shared-events/src/victory-shared-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ export default class VictorySharedEvents extends React.Component {
const names = childNames.slice(index, index + newChildren.length);
const results = React.cloneElement(child, child.props, alterChildren(newChildren, names));
return memo.concat(results);
} else if (child.type && isFunction(child.type.getBaseProps)) {
} else if (
childNames[index] !== "parent" &&
child.type &&
isFunction(child.type.getBaseProps)
) {
const name = child.props.name || childNames[index];
const childEvents =
Array.isArray(events) &&
Expand Down

0 comments on commit 1b3c1a5

Please sign in to comment.