AppRegistry.registerComponent(android开发) 入坑
Error: Element type is invalid: expected a string (for built-in components)
or a class/function (for composite components) but got: object.
You likely forgot to export your
component from the file it's defined in,
or you might have mixed up default and named imports.
1.使用AppRegistry.registerComponent
import {AppRegistry} from ‘react-native’;
import App from ‘./App’;
AppRegistry.registerComponent(appName, () => App);
appName要与android/app/src/main/java/com/xxx/MainActivty中的
protected String getMainComponentName() {
return “xxx”;
}
appName要与xxx的名字一致,或者将xxx改为 appName;
本文地址:https://blog.csdn.net/yzcbk/article/details/107939929
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论