gpt4 book ai didi

react-native - Android和iOS的注册项目名称在哪里修改?

转载 作者:行者123 更新时间:2023-12-04 00:39:47 24 4
gpt4 key购买 nike

在 React-Native 中,我想在“registered_name”下方进行更改:

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

我应该在 Android 和 iOS 文件中的什么地方更改此名称?

谢谢。

最佳答案

index.ios.js & index.android.js

更改类名

 class MyAppName extends React.Component{

和 AppRegistry

 AppRegistry.registerComponent('MyAppName', () => MyAppName);

iOS:/ios/MyAppName/AppDelegate.m

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyAppName"
initialProperties:nil
launchOptions:launchOptions];

安卓:/android/appsrc/main/java.com/myappname/MainActivity.java

mReactRootView.startReactApplication(mReactInstanceManager, "MyAppName", null);

关于react-native - Android和iOS的注册项目名称在哪里修改?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33496607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com