尝试运行简单的 stackNavigator 时出现错误“(0,_reactnavigation.createStackNavigator)”......有人可以帮忙吗?
错误发生在 const AppStackNavigator = createStackNavigator (....它的值为零
1. simple login screen
import { View, Text, Card, Button } from 'react-native';
import React from 'react';
class LoginScreen extends React.Component {
render() {
return (
<View>
<Text>Hello Login</Text>
</View>
);
}
}
export default LoginScreen;
2. App.js
import { createStackNavigator } from 'react-navigation';
class App extends React.Component {
render() {
return (
<View>
<AppStackNavigator />
</View>
);
}
}
const AppStackNavigator = createStackNavigator({
Login: { screen: LoginScreen },
});
export default App;
3. package.json
"react": "16.3.1",
"react-native": "^0.55.4",
"react-navigation": "^2.5.5",