Fix disabled ripple click error

If ripple prop is false, this.refs.ripple will be undefined and will throw a TypeError every time handleMouseDown is called.
old
Felipe Matos 2015-11-11 01:02:55 -03:00
parent ae95446735
commit ff936cbf70
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class Button extends React.Component {
handleMouseDown = (event) => {
events.pauseEvent(event);
this.refs.ripple.start(event);
if (this.refs.ripple) this.refs.ripple.start(event);
if (this.props.onMouseDown) this.props.onMouseDown(event);
};