-
Notifications
You must be signed in to change notification settings - Fork 486
Description
Hi,
I have run into an issue with the navigator where going back to a previous screen having updated the state does not reflect the changes on the previous screen. I.e. the previous screen is stale and not re-rendered. It works fine on the web and the issue is only on Android (I am not yet setup to test on iOS).
My actual use case is for a page with list of things which when clicked show details of a particular item. Then there is a button on the details page to delete the item which on press triggers a prop method. The prop method emits an event to delete the item and also navigates back to the list as a side effect. I do the state change asynchronously so during the back animation the item detail page does not error out (due to missing item). However, after the navigation back the list screen should then update once the state is changed. This is not happening. Neither setState nor forceUpdate re-render the list screen which is the expected behavior.
I have created an isolated example that is a simple counter to illustrate the problem. Here is the basic flow:
Code for the example is at https://gist.github.com/a-s-o/e6424ba1fc0527daaf35e391ec01b074
Initial load
Navigate to second page and click emit event button
Show first page again (but problem: state has not updated!)
On the web, this works just fine. The problem is only on Android. Additionally, we can be sure that the state updated because if I go back to page 2 it shows the correct counter value of 1
Thanks in advance; any help is very much appreciated.


