Closed mohsen1 closed 7 years ago
Hmm, actually this would almost already work out of the box with Preact. It's overriding createElement, which just has to get renamed to h(). Maybe the lib could export the patch method and users call it themselves?
Because Preact is not using synthetic events, overriding the native event object properties is throwing
Uncaught TypeError: Cannot assign to read only property 'type' of object '#<TouchEvent>'
We were able to fix this issue by just using the original fastclick. Since it's patching the native event listeners and Preact is using the native event system it works.
Nice, that seems reasonable.
There's also this naive implementation I threw together a while back, though react-fastclick is much better. https://jsfiddle.net/developit/bx9vwxLt/
I don't have any experience with Preact, so I'm not sure how possible this would be. I could spend some time looking into it, though I think I'll run into issues pretty quickly if Preact does not use synthetic events.
Unless you are happy using the original fastclick? In which case, shall I close this issue?
Yes we switched to the original library. Thanks!
How hard is it to make this plugin work with Preact?
@developit can you recommend a solution? I volunteer to make it work.