I need to create two twin apps with React Native and both apps will be 90% the same they will use some shared components and the styles will be different.
the question is : should i create one react native project and from there to building two apps
and the folder structure will be :
and when I want to build one of the apps I will need to change the main component.
or should I create to different React Native projects
and the folder structure will be :
I would like to know what is the right approach to do this kind of project
thanks !
This is absolutely a personal preference as stated in comments. One could easily increase the number of structure options beyond 2. Other than that I can share my experience on this.
We build an app, actually 4 (quadruplets), from a single react native project. We choose that way because our apps had to be highly similar. They share same functionality. Furthermore, when one has more than one of these apps installed on their device they can easily switch between apps via deep linking. However they differ on the theme colors, logos, names and backend services to call etc. One of the ways to create multiple apps from a single project is to rename the project. But you can still produce multiple apps while keeping the project name same. Then you need to change some project files accordingly. These files are, for iOS;
For Android;
Actually changing all these files manually is an error-prone and cumbersome action. So that in order to manage these changes we wrote a bash script that converts a base app to the version that we want. Using this approach we can manage 8 apps (quadruplets for iOS and Android) from a single project repo. In the end we are really happy about using React Native which let us build 8 production quality native apps in 3 months without knowing native app development at production level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With