A monorepo with a mobile and web app using React Native and React Native Web. Parcel Bundler was used to bundle the web application.
The approach uses a symlink to the shared
folder in the mobile app.
This was based on the Web and mobile apps using React Native Web tutorial on YouTube by Robin Heinze.
Follow the instructions on the Setting up the development environment page of the React Native website.
-
Clone the repo.
-
Run
yarn install
in themobile
andweb
directory. -
Run
pod install
in themobile/ios
directory. -
Copy the full path of the
mobile/app/shared
directory and run the following command in the terminal in the web directory to create a symlink:For MacOS:
ls -s <full-path-to-mobile-app-share> shared
The
mobile/shared
folder is now shared between the mobile and web app. -
In the mobile directory, run
yarn ios && yarn android
to start the iOS and Android app, respectively. -
In the web directory, run
yarn start
to start the web server. -
Make changes to the files in the
mobile/shared
folder to see changes in the iOS, Android and Web apps.