Some questions about data Management in react-native

has recently been developing a project for react-native.

clipboard.png

there is such a piece of data on my first-level page.
then click on the details and click on so-and-so to the third-level page, I changed the address information.

but when you go back to the first-level page, since the page will not be destroyed, all hook functions such as componentDidMount will not be used. The data is still old data.
data is not managed by redux, because before I thought that since it would not be destroyed, what is the impact of storing state?!

now my idea is to make a publish subscription, subscribe to an event in the componentDidMount of the first-level page, publish the event when the third-level page modifies the data, and then force the component to be updated after the event is triggered on the first-level page.

I would like to ask you how to solve such a problem?

When you return

, you can use navigator.push

instead.
Menu