Closed frederickfogerty closed 9 years ago
React.initializeTouchEvents
is removed in 0.14 I think, you should not call it anymore as it has no effect anyway
you should not call it anymore as it has no effect anyway
Do you have a source for this? @slorber
@frederickfogerty https://github.com/facebook/react/pull/3442
Thanks, so I can go through and replace Tappables with normal elements again?
No I just say that you can remove your call to React.initializeTouchEvents
, as well as React-tappable
You can send a PR so that React-tappable do not call it anymore, it's just this line to remove: https://github.com/JedWatson/react-tappable/blob/master/src/Tappable.js#L4
I've just pushed an update with that line removed, thanks @slorber.
@JedWatson 0.14 has not been released yet, I'm not sure I endorse this change. If there was a way to conditionally call initializeTouchEvents
depending on the react version, I think that'd be better.
@frederickfogerty based on my research:
initializeTouchEvents
was required in React 0.11, which was the current version when react-tappable
was developed initially. It doesn't seem to have been required since 0.12, and touch events work just fine in 0.13 without it. The function has been removed in 0.14.
We could wrap initializeTouchEvents
in a try { ... } catch(e) { ... }
statement (arguably better than a React version check) but given react-tappable doesn't support 0.11 anyway, I figured it's safe just to remove.
This is all based on my interpretation of the related issues in facebook/react so if I'm wrong, I'm happy to reinstate it with the try/catch for 0.14 compatibility.
Oh, apologies, I didn't realise it didn't do anything on 0.13 (or even 0.12). In that case, looks fine to me, thanks for the update!
I tried out React 0.14 today but was met with
Uncaught TypeError: React.initializeTouchEvents is not a function
Related: https://github.com/zilverline/react-tap-event-plugin/issues/24