Posts tagged "monorepo"

How to share code between React and React Native app using React Native Web and Yarn Workspaces

When I started at my current company we had to release an MVP for iOS, Android and Web in under three months. For iOS and Android ofcourse we went with React Native and in order to move fast I decided for the web app I will use React and share as much code as possible between the two using a monorepo system.

I decided to use react-native-web which allowed us to share UI code between the two as well and subsequently share more than 90% of the code. This approach allowed us to save a lot of development time which would be spent on coding a separate web app.

I will show you in this tutorial how you can do that.

Project Files

https://github.com/saadibrahim/universal-react-app

Useful Links

Screenshot