generator-rn-boilerplate v0.0.2
React Native Project Generator
This Yeoman generator sets up a new React Native project with ease.
Getting Started
Install Yeoman globally:
npm install -g yoInstall the React Native Project Generator:
npm install -g generator-rn-boilerplateCreate a new React Native project:
yo generator-rn-boilerplateFollow 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:
Navigate to the
android/app/src/main/res/values/directory.Open the
strings.xmlfile.Locate the following line:
<string name="app_name">MyApp</string>Replace
MyAppwith your desired app name.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:
Navigate to the
android/app/src/main/java/com/yourcompanyname/yourappname/directory.Open the
MainActivity.javafile.Locate the
getMainComponentNamemethod:@Override protected String getMainComponentName() { return "MyApp"; }Replace
"MyApp"with your desired app name.Save the file.
Building and Running
After customizing your project, you can build and run it:
Android:
npx react-native run-androidiOS:
npx react-native run-ios
Additional Information
For more information on React Native, please refer to the official documentation.
Happy coding!