简体   繁体   中英

React Native - Share code for different applications

I have a react native application called A , now I want create another application very similar to A , I only need change some colours the rest of the code is exactly the same. One option could be create a new application B and copy all the code from A and change the hard coded colours, obviously it doesn't look very clever because now I have to maintain two different applications.

There are any way to load the colours information from a theme file and then when I start the application determinate what file the application should use?

You can do it using product flavors.

Take a look at the docs: http://developer.android.com/tools/building/configuring-gradle.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM