Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create multiple react native apps with same functionality

I am currently building a mobile app using react native. This is a parent app where parents can view marks, homework, fee details etc. We work with multiple schools and each school will need an app of their own. Only changes between these apps as of now is the splash screen and the app icon.

What can I do to keep my codebase more organized and less redundant between every app so that it will be easy to maintain, and also for new releases?

like image 951
Kireeti K Avatar asked Jul 24 '18 11:07

Kireeti K


People also ask

What are you building with React Native?

I am currently building a mobile app using react native. This is a parent app where parents can view marks, homework, fee details etc. We work with multiple schools and each school will need an app of their own. Only changes between these apps as of now is the splash screen and the app icon.

How to add multi-language support to your react native app?

Adding multi-language support is that easy. You can now use react-native-localize to easily provide multiple language support in your app which can help in increasing user’s app usage. Find the source code in the Github repo here.

Is there a react native app for schools?

Bookmark this question. Show activity on this post. I am currently building a mobile app using react native. This is a parent app where parents can view marks, homework, fee details etc. We work with multiple schools and each school will need an app of their own. Only changes between these apps as of now is the splash screen and the app icon.

How to render different components in react app?

You can use environment variables to do this. If you use an IDE like WebStorm, you can create different run configurations for every app and set Environment to REACT_APP_SETUP=app1 for example. Then you just render different root components in your index.js


1 Answers

I have done a similar task before. I ported 4 different apps with unique styles from a single react native code base. You can read some related bits here.

Basically you just need to rename your app before building for ios and android.

If you need to apply different styles it is a much harder task just to explain here. However to give a hint, you need to make your app styles reusable like a theme. In my case I was using nativebase themeing. And before renaming the project I was changing the theme folder to be used for each app with a bash script. This gist might give you an idea.

like image 135
milkersarac Avatar answered Sep 22 '22 18:09

milkersarac