Closed miuirussia closed 1 year ago
Was able to reproduce the issue here https://github.com/ptrfrncsmrph/purescript-react-events-bug and confirmed the fix locally
Thanks for this @miuirussia and @ptrfrncsmrph for additional testing. Just approved to run it through ci and should be able to get this in shortly
Since purescript has ability to compile with different backends (as https://github.com/aristanetworks/purescript-backend-optimizer), functions can be compiled as arrow functions, which results error in react. So we must explicitly specify, that the preventDefault and stopPropagation functions require a SyntheticEvent in 'this'.
See: https://github.com/facebook/react/blob/afe6521e134178920f0523ede4c715942d8f0564/packages/react-dom-bindings/src/events/SyntheticEvent.js#L89