Skip to content

Commit

Permalink
fix(OverflowMenu): resolve child.props NPE (#7838)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored Feb 18, 2021
1 parent 5dbab82 commit 752a1fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class OverflowMenu extends Component {
const childrenWithProps = React.Children.toArray(children).map(
(child, index) =>
React.cloneElement(child, {
closeMenu: child.props.closeMenu || this.closeMenu,
closeMenu: child?.props?.closeMenu || this.closeMenu,
handleOverflowMenuItemFocus: this.handleOverflowMenuItemFocus,
ref: (e) => {
this[`overflowMenuItem${index}`] = e;
Expand Down

0 comments on commit 752a1fe

Please sign in to comment.