reason-react
reason-react copied to clipboard
Implement React's Pointer Events
React supports Pointer Events now. It works in Chrome, Firefox, and IE/Edge. You have to bring your own polyfill for Safari but there are some mature ones.
Unfortunately, even if I include the polyfill, I can't just set onPointerDown
events on my ReasonReact DOM elements as the type system considers it an error. Could we change this? And also add the custom attributes required by PEP? Is there a way for me to extend what attributes are allowed on a DOM element in order to support this myself? Should I be using cloneElement as an escape hatch?
For the sake of cleaning up the repo (and given how old this issue is) I'm going to close this out.
Please re-open if this is still relevant. Thanks!
I haven't checked recently. Did this ever get implemented?
Nope! Thanks for bringing this up. I'd love your help in starting a PR for this if you have insight on pointer events :smile:
Here's the PR I wrote 2 years ago attempting to add this to my local setup: https://github.com/reasonml/reason-react/pull/581. Ultimately I didn't use it though. Maybe someone else can make sense of this?
Ok, I'm working on a proper change, but... it would be nice if ReactEvent.re(i) followed the inheritance structure for event types instead of just repeating their fields over and over. Is that possible? I'll ask on discord for help with this tomorrow.
The new PR: https://github.com/reasonml/reason-react/pull/584