Tell us which versions you are using:
Actions.pop({ popNum: 2 }) goes 2 scenes back
Actions.pop({ popNum: 2 }) goes only one scene back
Try Actions.popTo('sceneKey') instead (Pops the stack until the)
https://github.com/aksonov/react-native-router-flux/blob/master/docs/API.md#actions
@onrige your suggestion did work for me, thank you.
I do think that the documentation is incorrect - it states:
Actions.pop()will pop the current screen. It accepts following optional params:
{popNum: [number]}allows to pop multiple screens at once
But in my tests, and as reported by @mmaschenko, passing popNum does not work:
Actions.pop({popNum: 2}) // Only pops back one screen
@guarani You are welcome :) Could you give me the link to this docs? I can't find anything in current docs (v4) you talk about, sorry.
Your 100% right, I was looking at (v3) docs and using (v4) 馃檭, sorry.
Why not support popNum锛焩4
how did you implement popNum functionality in v4?
@SaffaShujah
pop: function (props) {
const {popNum} = props || {}
if (popNum > 1) {
const routes = Actions._state && Actions._state.routes
if (routes && routes.length > popNum) {
const route = routes[routes.length - popNum - 1]
//v4 not support props refresh, not sure futrue
Actions.popTo(route.routeName, props)
if (Object.keys(props).length > 1) {
Actions.refresh(props)
}
}
} else {
Actions.pop()
if (props) {
Actions.refresh(props)
}
}
},
Most helpful comment
Why not support popNum锛焩4