So I've two tab scenes, created through react-native-router-flux
as shown below.
Default tab scene has a Map, while other has a list view for the same data.
Once the location is detected, data is been dispatched through redux and is shown on the map.
How to show the same data in form of listview in the other tab, without making a separate call again?
<Scene key={'tabBar'} tabs
tabBarIconContainerStyle={AppStyles.tabBarIconContainer}
pressOpacity={0.95}>
<Scene
{...AppConfig.navbarProps}
key={'map'}
component={MapScreen}
icon={props => TabIcon({ ...props, icon: 'map-marker' })}
></Scene>
<Scene
{...navbarPropsTabs}
key={'home'}
component={FeedScreen}
icon={props => TabIcon({ ...props, icon: 'view-list' })}
></Scene>
</Scene>
If you're not passing the redux props to a state, and directly to the render/return of the second view, it should rerender as soon as the redux props changes. If you need to pass them to a state, you can use componentWillRecieveProps to get the new props to the state when they do change. If you could post the code i'd be glad to try to help more.