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

Unable to use in a new React Native project #7

Open
aweary opened this issue Apr 15, 2018 · 5 comments
Open

Unable to use in a new React Native project #7

aweary opened this issue Apr 15, 2018 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@aweary
Copy link
Owner

aweary commented Apr 15, 2018

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.

@aweary aweary added the help wanted Extra attention is needed label Apr 15, 2018
@wKovacs64
Copy link
Contributor

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? 😛

@wKovacs64
Copy link
Contributor

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 facebook/metro#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:

  1. Wait it out. RN users will not (easily) be able to use react-copy-write for the time being.
  2. Temporarily downgrade Babel to v6 to accommodate RN users until the next version is released.

Thoughts, @aweary?

@VahidBo
Copy link

VahidBo commented Jul 16, 2018

@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.

@aweary
Copy link
Owner Author

aweary commented Jul 16, 2018

Awesome, thanks for checking and letting me know @VahidBo! and thanks for investigating it in the first place @wKovacs64

@aweary aweary closed this as completed Jul 16, 2018
@aweary
Copy link
Owner Author

aweary commented Oct 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants