-
Notifications
You must be signed in to change notification settings - Fork 157
Suggestion for documentation - PEP with React #255
Comments
Once #151 is implemented we no longer need the non-standard attribute. So hopefully this issue is obsolete soon. |
We decided that this can be added to the README, in a section similar to Using PEP with jQuery. Can you send a PR adding that? |
I wrote a React component that allows declarative pointer event binding, and setting of the It has been working for me as an easy substitute until React officially supports pointer events. Even then, it may be handy for the Update: <Pointable /> now lives in its own repo and is on npm: This doesn't resolve the documentation issue, but hopefully is helpful. |
I'm going to close this. If someone wants to send a PR with documentation, we can certainly add it. |
Hey @scottgonzalez, I'm afraid any explanation to do this the right way gets pretty lengthy if all bases are to be covered. While it's easy to make a React component that binds pointer events and sets I think it's a lot of overhead if someone just wants declarative pointer event binding to work. So, this is exactly what <Pointable/> does under the hood. A user can bind pointer events exactly like other React events. The main difference is that instead of getting synthetic event objects from React, the handlers will receive events directly from the browser, or PEP. I've written unit tests for the internal diffing code, and haven't experienced any issues in my real-world usage. If you're open to linking to an external package for React support, I'm happy to write up a usage example for it, and stand behind the package. |
Absolutely. Can you send a PR that adds a link with a short blurb? Just a sentence or two is fine, but feel free to write more. |
In order to get the PEP polyfill working with standard elements in React JSX one must add the 'touch-action' attribute after the component has mounted as non-standard attributes will not be rendered.
eg. this will not render the 'touch-action' attribute:
Whereas this works fine:
This may be too specific specific to include in the documentation, but I thought it might be helpful for those who have run into the same problem.
The text was updated successfully, but these errors were encountered: