Skip to content

Commit

Permalink
[ClickAwayListener] Improve the propTypes definition
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 12, 2016
1 parent 93d83c8 commit 2d99b2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Snackbar/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class Snackbar extends Component {
const styles = getStyles(this.props, this.context, this.state);

return (
<ClickAwayListener onClickAway={open && this.componentClickAway}>
<ClickAwayListener onClickAway={open ? this.componentClickAway : null}>
<div {...other} style={prepareStyles(Object.assign(styles.root, style))}>
<SnackbarBody
action={action}
Expand Down
4 changes: 2 additions & 2 deletions src/internal/ClickAwayListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const unbind = (callback) => clickAwayEvents.forEach((event) => events.off(docum

class ClickAwayListener extends Component {
static propTypes = {
children: PropTypes.node,
onClickAway: PropTypes.any,
children: PropTypes.element,

This comment has been minimized.

Copy link
@oliviertassinari
onClickAway: PropTypes.func,
};

componentDidMount() {
Expand Down

0 comments on commit 2d99b2d

Please sign in to comment.