react-navigation 报错

图片描述

装了navigation 编译后报错
图片描述

import { StackNavigator } from 'react-navigation';

class ComponentLogin extends Component{
    constructor(props){
        super(props);
        this.state = {
            text:'用户'
        };
    }
    static navigationOptions = {
        title: 'Welcome'
    };
    render(){
        // const { navigate } = this.props.navigation;
        return(
            <View>
                
                <Text>test</Text>
            </View>
        )
    }
}

//导航注册
const App = StackNavigator({
    Home: {screen: ComponentLogin},
    // Profile: {screen: controlPage},
});
//app注册
AppRegistry.registerComponent('App', () => App);

安装后 引用上就报错,求各位大神看看

阅读 2.9k
1 个回答

你这是全部代码嘛 看看版本是多少

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题