diff --git a/examples/form.jsx b/examples/form.jsx index 265bb26..43f4142 100644 --- a/examples/form.jsx +++ b/examples/form.jsx @@ -11,7 +11,7 @@ class Form extends Component { name: '', }; - this.submit = data => this.setState(state => ({name: data})); + this.submit = (_form, data) => this.setState(state => ({name: data})); this.cancel = _ => console.log('Form canceled'); } render() { diff --git a/examples/framer.js b/examples/framer.js index 9482a1f..ceb0a42 100644 --- a/examples/framer.js +++ b/examples/framer.js @@ -47,7 +47,7 @@ class Demo extends React.Component { */ } - handleMouseDown = (pos, pressY, event) => { + handleMouseDown = (pos, pressY, node, event) => { if (this.state.isPressed === false) { const {y} = event; this.setState({ @@ -57,14 +57,14 @@ class Demo extends React.Component { originalPosOfLastPressed: pos, }); } else { - this.handleMouseMove({ + this.handleMouseMove(node, { ...event, action: 'fake-mousemove', }); } }; - handleMouseMove = (event) => { + handleMouseMove = (_node, event) => { if (event.action !== 'fake-mousemove') { return; } diff --git a/src/fiber/events.js b/src/fiber/events.js index cca641e..2514d24 100644 --- a/src/fiber/events.js +++ b/src/fiber/events.js @@ -25,10 +25,7 @@ const eventListener = (node, event, ...args) => { */ if (typeof handler === 'function') { - if (event === 'focus' || event === 'blur') { - args[0] = node; - } - handler(...args); + handler(node, ...args); } };