I have a TabNavigator and I want to use states to select
which component is showing in each tab. Each tab has 4 different
components. Is this feasible or am I just crazy? It looks like it
is only working on the first tab, because when it is initialized
the state is set. In the other tabs, it doesn't appear that the
state is affected.
Have you looked into using nested ViewStacks? Instead of
using states of the TabNavigator component, you could try making
each parent tab a ViewStack then nest the components in each stack
component. That may not make much sense, but I think it may
After re-reading this, you could try making a custom
component, which has the four components you want in it. Then
programmatically set their visibility and includeInLayout to true
Use multiple instances of these components for the children
of your tabNavigator. By virtue of them being separate components
they should keep their state when you switch around between them.