假设您按以下方式导航
screen-a (initial)
screen-b (push)
screen-a (pop)
我认为在android中,我们可以使用 Activity 的onResume
来跟踪屏幕
react-native中有类似onResume
的东西吗?
我不是在谈论应用程序状态,我在谈论单独的 View (这就像android中的Activity,iOS中的ViewController)
最佳答案
尝试使用lifeCycle方法componentDidMount()
class App extends Component {
componentDidMount() {
console.log('onResume alternative of android works?')
}
render() {
return (..)
}
}
关于android - React Native,检测屏幕恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58959463/