Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider converting the boilerplate into a React Native template #67

Open
acostalima opened this issue Mar 16, 2021 · 0 comments
Open

Comments

@acostalima
Copy link
Contributor

acostalima commented Mar 16, 2021

One of the issues of working with a bootstrapped React Native app is that the files of the native iOS and Android project must be refactored in order to use the target app's name. Several files must be renamed and/or their contents changed to remove all occurrences related to React Native with MOXY.

If done manually, this process is quite tedious and very error prone. There are automatic, unofficial solutions out there, such as react-native-rename, but they tend to be quite troublesome. While on Android it is fairly trivial to go through all project files manually, this is not the case for iOS.

Instead, we can leverage React Native's CLI to initialise a provide a template option which tells the CLI which template to use.
For example, to initialise a React Native app with TypeScript support, we can run:

$ npx react-native init MyApp --template react-native-template-typescript

We can create our very own, custom template and initialise new apps based on it. The initialisation process should already take care of naming files and update their contents automatically given the desired app name. Among other things, we still need to manually define the app's package name (Android) and bundle identifier (iOS), but these changes are trivial and it is something we would always have to do on an app basis regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant