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 installin themobileandwebdirectory. -
Run
pod installin themobile/iosdirectory. -
Copy the full path of the
mobile/app/shareddirectory 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/sharedfolder is now shared between the mobile and web app. -
In the mobile directory, run
yarn ios && yarn androidto start the iOS and Android app, respectively. -
In the web directory, run
yarn startto start the web server. -
Make changes to the files in the
mobile/sharedfolder to see changes in the iOS, Android and Web apps.