static navigationOptions = ({navigation, screenProps}) =>({
title: '厂区列表',
headerRight: <Button
color = "#3281DD"
onPress={()=>navigation.state.params.navigatePress()}
title="修改服务器IP"
/>,
gestureResponseDistance:{horizontal:300},
});
componentDidMount(){//在初始化render之后只执行一次,在这个方法内,可以访问任何组件,componentDidMount()方法中的子组件在父组件之前执行
this.props.navigation.setParams({navigatePress:this.onPressToChangPwd})
}
onPressToChangPwd =()=> {//跳回主页退出
const { navigate } = this.props.navigation;//跳转页面
navigate('changePwd');
}