JedWatson / react-tappable

Tappable component for React
http://jedwatson.github.io/react-tappable/
MIT License
863 stars 90 forks source link

Fix nulled event in onPress callback. #87

Closed AndrewSouthpaw closed 7 years ago

AndrewSouthpaw commented 7 years ago

The SyntheticEvent is pooled (https://facebook.github.io/react/docs/events.html#event-pooling) for performance reasons, which means the event object cannot be normally accessed asynchronously. Persisting the event object fixes the issue.

Fixes #62

dcousens commented 7 years ago

Will this have other side effects?

AndrewSouthpaw commented 7 years ago

Not as far as I can tell? We've been using it in production with no negative impacts. But then, I don't know this library super well. :)

dcousens commented 7 years ago

We should only need to do this if onPress exists