Skip to content

Consider converting the boilerplate into a React Native template #67

@acostalima

Description

@acostalima

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions