Is it possible to use Lerna (lernajs.io) with React Native? I'm attempting to create new project with the following structure:
MyApp
packages
myapp-core
myapp-mobile
myapp-web
lerna bootstrap doesn't seem to have any issues with core or web, but mobile (which is a React Native project) refuses to find the myapp-core module.
I recall there is some issue with npm link in React Native. Is that what is causing the problem? Is this functionality something that will eventually exist?
It looks like as of
react-native: 0.40.0, lerna works as expected. I created a minimal demo app that uses asharedpackage to change the background color of both a React and a React Native app for those who are interested:https://github.com/samcorcos/learna-react-native
Steps to reproduce:
cdinnpm install./node_modules/.bin/lerna bootstrapThen you can run each app (
npm startfor react,react-native run-iosfor react native) and you'll see the background changed to red based on the input from the shared repo. When you add new packages, make sure you add the new package to each of the relevantpackage.jsonfiles, just as I've addedsharedto both the web and mobile projects.Note that this project does not take advantage of Lerna's
--independentversioning system.