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

React 16 Support #84

Closed
junosuarez opened this issue Aug 10, 2017 · 4 comments · Fixed by #97
Closed

React 16 Support #84

junosuarez opened this issue Aug 10, 2017 · 4 comments · Fixed by #97

Comments

@junosuarez
Copy link

Currently this is blocked on an upstream dependency, react-native-web - they're tracking this at necolas/react-native-web#364

When trying to run against react@16.0.0-beta.5, it looks like:

Error: Cannot find module 'react-dom/lib/EventPluginHub'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/-/Code/zendesk/protoloop-4/node_modules/react-native-web/dist/modules/injectResponderEventPlugin/index.js:1:83)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
@metakermit
Copy link
Contributor

The upstream dependency can be fixed using this alias., but react-primitives itself seems to be using old-style React.createClass calls which don't work in React 16.

TypeError: React.createClass is not a function
node_modules/react-primitives/lib/modules/Touchable.js:77
  74 | 
  75 | 
  76 | // eslint-disable-next-line react/prefer-es6-class
> 77 | return React.createClass({
  78 | displayName:'Touchable',
  79 | propTypes:{
  80 | accessible:PropTypes.bool,

Any suggestions for how to overcome this?

@ljharb
Copy link

ljharb commented Sep 28, 2017

react-primitives should change to use create-react-class, i think.

metakermit added a commit to metakermit/react-primitives that referenced this issue Sep 28, 2017
ktj added a commit to ktj/react-primitives that referenced this issue Oct 10, 2017
lelandrichardson added a commit that referenced this issue Nov 9, 2017
@geyang
Copy link

geyang commented Dec 11, 2017

@js-n I have upgraded to 0.4.4, but the problem still persists. I'm using the {StyleSheet} from "react-primitives".

I get the original error message as reported by OP.

@theTechie
Copy link
Contributor

We are not using the latest version of react-native-web (0.2.0). We are still using "react-native-web": "0.0.x",.

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

Successfully merging a pull request may close this issue.

5 participants