react.js - react-navigation 报错
本文介绍了react.js - 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);
安装后 引用上就报错,求各位大神看看
解决方案
你这是全部代码嘛 看看版本是多少
这篇关于react.js - react-navigation 报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文