0
我正在使用react-native
框架來開發我的小android應用程序。我試圖從index.android.js.when重定向到Home.js,當我運行它時,它顯示我的紅色錯誤消息模擬器返回響應錯誤500反應本機
index.android.js
import React, { Component } from 'react';
import {AppRegistry,Text,View} from 'react-native';
import Home from 'App/Component/Home';
export default class mylApp extends Component {
render() {
return (
<View>
<Home />
</View>
);
}
}
AppRegistry.registerComponent('reactTutorialApp',() => reactTutorialApp);
Home.js
import React, { Component } from 'react';
import {Text,View} from 'react-native';
class Home extends Component {
state = {
myTxt: 'hiiiiiiiiiiiiiiiiiiiiiii';
}
render() {
return (
<View>
<Text>
{this.state.myTxt}
</Text>
</View>
);
}
}
export default Home;
現在它顯示'意外的令牌,預計,(6:24) 在C:\用戶\ Yasiru \ AndroidStudioProjects \新建文件夾\ reactTutorialApp \軟件\組件\ Home.js' – Tje123
仍然相同error.'Unexpected令牌,預計,' – Tje123
是的,我已經替換爲您code.but兩個指數和家庭JS它的顯示意外的標記在home.js文件 – Tje123