react native change app name code example

Example 1: how to change package name in react native

I have changed project subfolder name from:
"android/app/src/main/java/MY/APP/OLD_ID/"
to: "android/app/src/main/java/MY/APP/NEW_ID/"

Then manually switched the old and new package ids:

In: android/app/src/main/java/MY/APP/NEW_ID/MainActivity.java:

package MY.APP.NEW_ID;
In android/app/src/main/java/MY/APP/NEW_ID/MainApplication.java:

package MY.APP.NEW_ID;
In android/app/src/main/AndroidManifest.xml:

package="MY.APP.NEW_ID"
And in android/app/build.gradle:

applicationId "MY.APP.NEW_ID"
(Optional) In android/app/BUCK:

android_build_config(
  package="MY.APP.NEW_ID"
)
android_resource(
  package="MY.APP.NEW_ID"
)
Gradle' cleaning in the end (in /android folder):

./gradlew clean

Example 2: react native change app name

Android
1. Modify displayName in app.json file
2. Modify app_name in android/app/src/main/res/values/strings.xml
3. cd android -> ./gradlew clean
4. cd .. -> react-native run-android
IOS
1. Modify Display Name in Project target (General Tab) 
2. Or in info.plist file string value of CFBundleDisplayName key