1
我剛開始學習React Native,我試圖在世博會上做RN。現在我收到這個錯誤。React.createElement:類型在世博會上無效
Warning: React.createElement: 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.
我的代碼是
import React from 'react';
import {Text, AppRegistry} from 'react-native';
const App =() => (
<Text>Some Text </Text>
);
AppRegistry.registerComponent('helloworld',() => App);
我又寫道在App.js這個鱈魚文件
我寫的代碼是錯了?我實際上是從教程中獲取了這些代碼。 –
從哪個教程? –
https://www.udemy.com/the-complete-react-native-and-redux-course/?altsc=610300 –