I managed to do it with a fake empty initial scene. It's very hacky solution and animation from C to B still doesn't work correctly.
import React, {Component} from "react";
import {AppRegistry} from "react-native";
import {Scene, Router, Actions, ActionConst} from "react-native-router-flux";
import A from "./A";
import B from "./B";
import C from "./C";
class App extends React.Component {
componentDidMount() {
const params = {
onBack: () => Actions.b({
direction: 'fade',
onBack: () => Actions.a({
direction: 'fade'
})
}),
duration: 0
};
Actions.c(params);
}
render() {
return (
<Router>
<Scene key="root" style={{paddingTop: 60}}>
<Scene key="empty"
component={class extends Component{render() {return null}}}
/>
<Scene key="a" component={A} title='A' type={ActionConst.RESET}/>
<Scene key="b" component={B} title='B'/>
<Scene key="c" component={C} title='C'/>
</Scene>
</Router>
)
}
}
AppRegistry.registerComponent('untitled', () => App);
C
would be the first screen of the app. – Highlandex-navigation
– Highlandex-navigation
, please? – Highlandstore.subscribe is not function
error with this code gist.github.com/sealskej/c7580d4fe34760b4ae5767487e5d1755 – Highlandex-navigation
andimmediatelyResetStack
here gist.github.com/sealskej/a981e61d52567bcfeeacc9ade3ab3e0c Thanks @IrfanAyaz! – HighlandcomponentDidMount()
andrender()
are called after stack reset. – Highland