Solvedreact native router flux Problem about pop and refresh

  • react-native-router-flux v3.36.0
  • react-native v0.34.1

Expected behaviour

I have the situation like that. I'm in scene A and push to scene B. I want to change something in scene B and pop to scene A and scene A should be update some data (not all). I used:

Actions.pop()
setTimeout(()=> {
Actions.refresh({test:true});
}, 10)

but it was not working well. Actually scene A is a tab scene, there are 4 tabs in there and all data in there should be update. Could you please to show me how to resolve this situation with react-native-router-flux. Thank you!

16 Answers

✔️Accepted Answer

Hello guys, I have the same problem with tab scene too : componentWillReceiveProps is not triggered using Actions.pop({refresh: {...}}) .

Other Answers:

 I resolve               Actions.pop({refresh: {test:Math.random()

you must put difference data ,it will work

You should use this:

Actions.pop({ refresh: { test: true }})

This will POP the current view off the stack and refresh the previous with the props being passed.

@ddolheguy This did not work for me. I used Actions.pop({refresh: {test:true}}). Previous scene was shown but none of the react component lifecycle methods of the component were called.

@iWebi when you call Actions.pop({refresh: {test:true}}) componentWillReceiveProps is called on the previous scene