我正在测试新的库Yea React Navigator。当我添加React Navigator时,所有代码都不起作用,而当我删除react Navigator时,它仍然不起作用。
class HomeScreen extends Component{
render(){
return(
<View>
<Text styles={{fontSize: 20}}>Kita berada Di menu Home</Text>
</View>
)
}
}
class DetailScreen extends Component{
render(){
return(
<View>
<Text styles={{fontSize:30}}>Hai Gan Kita Berada DiMenu DetailScreen</Text>
<View>
)
}
}
const AppContainer = createAppContainer(AppNavigator);
const AppNavigator = createStackNavigator({
{
Home: HomeScreen,
Detail: DetailScreen
},
{
initialRouteName:'Home'
}
})
export default class App extends Component<Props> {
render(){
return (
<View>
<Text>ZHALLOOOM</Text>
<View>
);
}
}
意外的令牌,预期的“}”