'Is it possible to get the state from my reducer into my navigation if its not a component,

I am using a different format for navigation but I want to show a number from state when people add items in the tab

tabBarBadge: 'allows a string';

but I need state from the store and I don't know how to access it in this format.

Wondering if its possible and how? can I call getstate()? or pass via the component in appjs.

import {createMaterialBottomTabNavigator} from 'react-navigation-material-bottom-tabs'
import LoginScreen from '../screens/LoginScreen';





const WorkoutNavigator = createStackNavigator({
  Search: HomeScreen,
   Workouts: WorkoutList,
   Display: WorkoutListDetailScreen,
   Play: PlayWorkoutScreen,
   Details: WorkoutDetail,
  

},
{
    
    defaultNavigationOptions: {
        headerStyle: {
          backgroundColor: Colors.twentyThree,
        },
        headerTintColor: Colors.accent,
        headerTitleStyle: {
          fontWeight: '100',
        },
      },
    }


);

const WorkoutFavTabNav = createMaterialBottomTabNavigator({
    Search: { screen:  WorkoutNavigator, navigationOptions: {
      tabBarIcon: (tabInfo) =>{
      return  <Ionicons name="search" size={25} color={tabInfo.tintColor}/>

      }
    }},
     Workout:{ screen:  FavoritesScreen, navigationOptions: {
      tabBarIcon: (tabInfo) =>{
      return   <Ionicons name="albums" size={25} color={tabInfo.tintColor}/>
              
      

      },
      tabBarBadge: 'I allow a string';
       }},
   

},{
     activeColor: Colors.accent,
   inactiveColor: Colors.primary,
   
    barStyle:{
      backgroundColor:'rgba(0, 0, 0, 0.71)'
    }



  
 
});


export default createAppContainer(WorkoutFavTabNav);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source