Tell us which versions you are using:
I am passing props to previous screen like Actions.Pop({variable: value}) on click of back button. I am not able to get the props in previous screen because there is no any component life cycle methods triggered.
can anyone please tell me which method is triggered on Action.Pop() operation and what is the way to pass props to previous screen on back button press?
In actual only popping is happened and we moved to previous screen.
1.
2.
3.
@vykumar pop(), by definition, will bring back the previous scene with all the context that it was previously set.
Why can't you just Go to Actions.MyDesiredScene({withMyNewProps...}); .?
You can pass props like this
NavigationActions.pop( {refresh: {variable: value} })
this prop change will be found in
componentWillReceivePropscallback in previous component
@waqas19921 This is nice, but how can the "automatic" pop of the hardware back (on Android) is handled? What should we do in this case, in order for a prop to have a different value there?
Thanks!
@waqas19921 @aksonov how can we do this to receive the props in CDM
Most helpful comment
You can pass props like this
NavigationActions.pop( {refresh: {variable: value} })this prop change will be found in
componentWillReceivePropscallback in previous component