0

How do I override onMouseDown for a GridItem?

I have something like this:

class TrackItem extends React.Component {
    onMouseDown(e) {
        this.props.onMouseDown.apply(e);
    }
    render() {
        return <div onMouseDown={this.onMouseDown.bind(this)}>item</div>;
    }
}

Which yields the error:

react-draggable.js:1050 Uncaught TypeError: Cannot read property 'button' of undefined

CWSites
  • 1,428
  • 1
  • 19
  • 34
nnyby
  • 4,748
  • 10
  • 49
  • 105

1 Answers1

0

It turns out I don't need apply:

this.props.onMouseDown(e);
nnyby
  • 4,748
  • 10
  • 49
  • 105