Open aweary opened 6 years ago
This is a weird one. I tried a bunch of tweaks/hacks but couldn't figure it out. The library works fine in RN if you copy out the built lib/index.js
and import it locally (as expected).
Know any babel/RN experts? 😛
I finally found the time to dig a little deeper and I think this is broken because the current version of React Native (0.55) depends on a version of Metro (0.30.0) that does not work with Babel 7 (see https://github.com/facebook/metro/issues/92). It sounds like newer versions of Metro will work with Babel 7, but projects currently using Babel 7 will remain incompatible with React Native until a newer version is released that depends on an updated version of Metro (which should be the next RN release).
As I see it, there are 2 choices:
react-copy-write
for the time being.Thoughts, @aweary?
@aweary Since the latest version of react-native
(0.56.0) is using Babel 7 it seems there is no problem to use the react-copy-write
in a react-native project. I inited a new react-native
project and tested react-copy-write
in it and everything worked great.
Awesome, thanks for checking and letting me know @VahidBo! and thanks for investigating it in the first place @wKovacs64
Re-opening, since apparently Expo still uses an older version of React Native. Since Expo is relatively popular, we should try to support it out of the box as well.
When importing react-copy-write in a React Native project it complains about it using Babel 7. I'm not sure why that would matter, but react-copy-write should work with RN out of the box.