我正在使用反馈导航与标签导航器和堆栈导航器的组合。我怎么能现在天气栈堆栈导航器是空的或包含一些值
componentWillMount() {
var self=this;
BackHandler.addEventListener('hardwareBackPress', () => {
console.log("Props",self.props);
if(stack of stack navigator has data){
navigate to Screen required
}else{
close the app
}
})
componentWillUnmount() {
var self=this;
BackHandler.removeEventListener('hardwareBackPress',self.backNav());
}
backNav(){
console.log("Navigating Back");
return false;
}
答案 0 :(得分:0)