在哪里更改Android和iOS的注册项目名称?

Sul*_*ane 2 react-native

在React-Native中,我想在'registered_name'下面更改:

AppRegistry.registerComponent('registered_name', () => test);

我应该在Android和iOS文件中更改此名称的位置?

谢谢.

Chr*_*man 6

index.ios.js和index.android.js

更改班级名称

 class MyAppName extends React.Component{
Run Code Online (Sandbox Code Playgroud)

和AppRegistry

 AppRegistry.registerComponent('MyAppName', () => MyAppName);
Run Code Online (Sandbox Code Playgroud)

iOS:/ios/MyAppName/AppDelegate.m

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"MyAppName"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
Run Code Online (Sandbox Code Playgroud)

Android:/android/appsrc/main/java.com/myappname/MainActivity.java

mReactRootView.startReactApplication(mReactInstanceManager, "MyAppName", null);
Run Code Online (Sandbox Code Playgroud)