How to update context value when going back to the React page?

Asked

Viewed 56 times

-1

I’m using the context to pass the data to the pages, but when I go back one page and change the value it has in the context, and then go forward to the other page, the page doesn’t update with the new values. They can teach me the logic so as soon as I navigate to the page, it update the data?

1 answer

0


I was able to resolve with React-Navigation useFocusEffect() which updates the data passed on it as soon as the page gets the focus.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.