Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for React 0.14 #45

Closed
frederickfogerty opened this issue Jul 19, 2015 · 9 comments
Closed

Support for React 0.14 #45

frederickfogerty opened this issue Jul 19, 2015 · 9 comments

Comments

@frederickfogerty
Copy link

I tried out React 0.14 today but was met with Uncaught TypeError: React.initializeTouchEvents is not a function

Related: zilverline/react-tap-event-plugin#24

@slorber
Copy link
Contributor

slorber commented Jul 20, 2015

React.initializeTouchEvents is removed in 0.14 I think, you should not call it anymore as it has no effect anyway

@frederickfogerty
Copy link
Author

you should not call it anymore as it has no effect anyway

Do you have a source for this? @slorber

@slorber
Copy link
Contributor

slorber commented Jul 21, 2015

@frederickfogerty
Copy link
Author

Thanks, so I can go through and replace Tappables with normal elements again?

@slorber
Copy link
Contributor

slorber commented Jul 22, 2015

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

@JedWatson
Copy link
Owner

I've just pushed an update with that line removed, thanks @slorber.

@frederickfogerty
Copy link
Author

@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.

@JedWatson
Copy link
Owner

@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.

@frederickfogerty
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants