0

I just finished creating an android app in react-native (RN). I need to create another app now. A lot of code is same across both apps. I want to create the second app within the same project and reuse all the common components rather than duplicating them.

I went through this SO question and configure android build variants link. They talk about how to create a new module, gradle config and organization of java code in different source sets like src/demoDebug/, src/debug/, src/demo/ and src/main/.

I don't think this will work with react-native because the entry point of RN app is index.android.js. For 2 apps to work out of the same project we need 2 entry points. Is there a way to define multiple entry points in a RN android app? Does RN support this? If yes, how to organize files of the two apps in the same project?

Community
  • 1
  • 1
Abhishek Nalin
  • 4,309
  • 5
  • 24
  • 32

1 Answers1

1

you can create git submodule and move all shared code to it

stereodenis
  • 3,618
  • 2
  • 22
  • 27