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

Loading w/ external React module #28

Closed
julieReitter opened this issue Jul 24, 2015 · 3 comments
Closed

Loading w/ external React module #28

julieReitter opened this issue Jul 24, 2015 · 3 comments

Comments

@julieReitter
Copy link

We're trying to use this library and Material UI in our app that is built with requirejs. We have a separate "react" module that's being loaded from a compiled version of React 0.13 and therefore we don't have access to the individual React modules that are needed for this patch to work.

One attempt we've made is to use browserify to build a patched version of react-with-addons and then include that in our module dependencies.

React = require("../../node_modules/react/dist/react-with-addons");
React.initializeTouchEvents(true);

injector = require("../../node_modules/react-tap-event-plugin/src/injectTapEventPlugin");
injector();

module.exports = React;

Is there a more straightforward way to accomplish this? Also, this didn't work initially. We had to downgrade to React 13.0 and react-tap-event-plugin 1.6 to get it to work.

@zdychacek
Copy link

+1

@hartmamt
Copy link

Quick webpack example of how to patch react-with-addons with the tap events plugin. This is required as far as I can tell if you want to use material-ui with react as an external dependency.
https://github.com/hartmamt/react-with-tap-events

@webuniverseio
Copy link

For anyone who'll come to here looking for solution, link from comment above will not work if you use React 14+ as support for initializeTouchEvents was removed.

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

4 participants