question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Actions.pop(refresh:{}) does not work for me

See original GitHub issue

Version

  • 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:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fanzhiricommented, Aug 27, 2019

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

1reaction
dextermbcommented, Sep 5, 2018

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found