Actions.pop(refresh:{}) does not work for me
See original GitHub issueVersion
- react-native-router-flux v4
- react-native v0.55.4
- react v16.3.1
Expected behaviour
I have screen A and Screen B when I redirect from A -> B, In B screen backing to A , I want A screen fetch data and rerender the screen everytime entering it
Actions.pop({
refresh: {someProp: Math.random()}
})
Actual behaviour
The api methions above does not work , so I did some workaround,
Actions.pop()
setTimeout(() => {
Actions.refresh({
someprop: Math.random() * 100
})
}, 10)
this can fire componentWillReceiveProps lifecycle method in A screen and I setState and rerender screen A in this way
I want to know why Actions.pop({refresh: {}})
does nothing in my case
It can not even fire componentWillReceiveProps unless move it in a setTimeout function
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:16 (6 by maintainers)
Top Results From Across the Web
How to call Actions.pop() and refresh the previous scene ...
pop() is called, it takes me to the previous screen but does not refresh it. I tried with Actions.pop({ type: reset }) but...
Read more >Get help with linked data type refresh errors - Microsoft Support
You may encounter refresh errors when you are working in a workbook with Data Types, either by manually refreshing or if Automatic Refresh...
Read more >Reload a widget after Navigator.pop() - Flutter Clutter
The action on his second screen could have affected the first screen, ... of pop() is null or false , nothing has changed...
Read more >Navigation prop reference
It's important to highlight the navigation prop is not passed in to all components; only screen components receive this prop automatically!
Read more >react-native-router-flux/CHANGELOG.md - UNPKG
26, - Actions.pop\(refresh:{}\) does not work for me [\#3172](https://github.com/aksonov/react-native-router-flux/issues/3172).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
today is 2019-08-27 , my Version react 16.8.6 react-native 0.60.5 react native router flux ^4.0.6 the problem still exists . can not fire componentWillReceiveProps . May need to adapt to the new life cycle "static getDerivedStateFromProps(props, state) " @aksonov
@atifplus Most features were broken after
4.0.0
(and I think^4.0.0-beta.31
) as that is when it changed to react-navigation^2.0
.There’s a pull request that is being worked on which will hopefully resolve these issues soon. https://github.com/aksonov/react-native-router-flux/pull/3240