hey everyone, I'm new to RNRF and everything seem easy so far, I just have one issue,
here is my Scenes
const App = () => (
<Router>
<Scene key="root">
<Scene
key="InitialScreen"
component={InitialScreen}
title="First screen"
initial
/>
<Scene
key="main"
component={Main}
title="Main"
/>
</Scene>
</Router>
);
inside InitialScreen
export default compose(
lifecycle({
componentDidMount() {
Actions.popTo('main');
// tryed also Actions.main() also didn't work
},
}),
)(InitialScreen);
my plan is to check some props over there and then to navigate to correct screen, but for some reason it doesn't work the screen remains on InitialScreen, I tried to use Actions.main() as a fn for clicking a button and then it works but inside a lifecycle (like componentDidMount / componentWillMount) it doesn't. not sure what I'm missing here.
thanks!
I just faced similar issue
https://github.com/RNRF/react-native-router-flux/issues/3302
The answer seemed a bit weird to me, let's say that's the only solution so what's count as a safe and minimal amount to pass to setTimeout.
Thanks.
setTimeout (even with zero delay) is necessary because of async react-native architecture
Most helpful comment
setTimeout(even with zero delay) is necessary because ofasyncreact-native architecture