Redisplaying a component when a tab is clicked

I use interactive navigation to navigate tabs in my reaction based application. I have four tabs. When I switch from Tab A to Tab B, I can see Tab B. When I return to Tab A and then back to Tab B without any changes, I can see Tab B.

But when I go back to Tab A, make some changes that will affect the display in Tab B, then press Tab B, I will get a blank tab B. My guess is what happens when the Tab A data is updated, it is trying to update the Tab component B. But since the Tab B component is not part of the view, it frees it.

Is there a way to re-render the Tab B component when I press Tab B? There is no re-rendering right now. It just shows that there is an empty list.

The code in Tab A and Tab B doesn't matter. The only thing that matters is when Tab A updates some data in the redux, Tab B re-displays, but since Tab B is not displayed, it seems to be empty! If I could re-render when I click on a tab, I expect the view to work fine. How to redraw on click tab?

enter image description here

+4
source share
1 answer

I would say check your gearbox. Is it possible that when you update the state due to changes in Tab A, you clear what Tab B needs?

0
source

Source: https://habr.com/ru/post/1691610/


All Articles