0.0.2 • Published 6 months ago

generator-rn-boilerplate v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

React Native Project Generator

This Yeoman generator sets up a new React Native project with ease.

Getting Started

  1. Install Yeoman globally:

    npm install -g yo
  2. Install the React Native Project Generator:

    npm install -g generator-rn-boilerplate
  3. Create a new React Native project:

    yo generator-rn-boilerplate
  4. Follow the prompts to customize your project.

Customization

Changing App Name

To change the app name displayed on Android, you need to update the strings.xml file. Follow these steps:

  1. Navigate to the android/app/src/main/res/values/ directory.

  2. Open the strings.xml file.

  3. Locate the following line:

    <string name="app_name">MyApp</string>
  4. Replace MyApp with your desired app name.

  5. Save the file.

Changing App Name in MainActivity.java

To change the app name used in the getMainComponentName method in MainActivity.java, follow these steps:

  1. Navigate to the android/app/src/main/java/com/yourcompanyname/yourappname/ directory.

  2. Open the MainActivity.java file.

  3. Locate the getMainComponentName method:

    @Override
    protected String getMainComponentName() {
        return "MyApp";
    }
  4. Replace "MyApp" with your desired app name.

  5. Save the file.

Building and Running

After customizing your project, you can build and run it:

  • Android:

    npx react-native run-android
  • iOS:

    npx react-native run-ios

Additional Information

For more information on React Native, please refer to the official documentation.

Happy coding!