react-native-mock
react-native-mock copied to clipboard
Incompatibility with react > 16
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-mixinreact-addons-create-fragmentreact-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!
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.
I try to remove the useless dependency in my project and it works. Do you want a PR ?
Yes, please! I'm surprised it's so simple, I was expecting much worse!
Any update on this issue?
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.
Thank you, @JonnyBurger! That does the trick, for now. This really needs to be merged.
@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 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.