react-native-mock icon indicating copy to clipboard operation
react-native-mock copied to clipboard

Incompatibility with react > 16

Open samouss opened this issue 8 years ago • 8 comments
trafficstars

Hello,

The latest release of React Native use the v16.0.0-alpha.6 of React. In this version the React team has deprecated and remove a lots of addons package, including:

  • react-addons-pure-render-mixin
  • react-addons-create-fragment
  • react-addons-update

https://github.com/facebook/react/issues/9207

Due to this BC the package throw an error when the test are running:

module.js:472
    throw err;
    ^

Error: Cannot find module 'react/lib/ReactComponentWithPureRenderMixin'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)

We should drop the import of this addons and create a new version for support this new release of React Native.

Any ideas?

Thanks!

samouss avatar Apr 07 '17 14:04 samouss

Wow, supprised they're depricating all those. Had a quick look through the issue you linked, but it doesnt sound like it's as simple as Facebook arent supporting these anymore. Is there a way we can change the require path / method to keep using these libraries? If not, we'll have to look into trying to remove the dependency on these, which sounds interesting.

RealOrangeOne avatar Apr 07 '17 15:04 RealOrangeOne

I try to remove the useless dependency in my project and it works. Do you want a PR ?

samouss avatar Apr 07 '17 15:04 samouss

Yes, please! I'm surprised it's so simple, I was expecting much worse!

RealOrangeOne avatar Apr 07 '17 15:04 RealOrangeOne

Any update on this issue?

pziemkowski avatar May 15 '17 14:05 pziemkowski

I appreciate you working on this! If you, like me, desperately want to upgrade, I published @samouss's branch as an npm package: https://www.npmjs.com/package/@jonny/react-native-mock

Install and update references in babel config and requires from react-native-mock to @jonny/react-native-mock.

No update / maintenance and I will unpublish the package when the main repository has been updated for a while.

JonnyBurger avatar May 16 '17 17:05 JonnyBurger

Thank you, @JonnyBurger! That does the trick, for now. This really needs to be merged.

jeaye avatar Dec 08 '17 20:12 jeaye

@JonnyBurger can you put up a github repo with your source for the react-native-mock fork? It would be nice to contribute to it :P it seems to be the only path forward for this repo

JAStanton avatar May 29 '18 15:05 JAStanton

@JAStanton I uploaded my fork here: https://github.com/JonnyBurger/react-native-mock

It has some other changes, like requiring react-native@^0.55. If it causes problems for others, I would be happy to take PRs.

JonnyBurger avatar May 31 '18 09:05 JonnyBurger