How to use the react-navigation.TabRouter function in react-navigation

To help you get started, we’ve selected a few react-navigation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-navigation_v3.x.x / test_react-navigation.js View on Github external
/**
 * StackRouter
 */

const stackRouter = StackRouter(innerRouteConfig);
const stackNavigateAction = {
  type: "Navigation/NAVIGATE",
  routeName: "Test3",
};
stackRouter.getStateForAction(stackNavigateAction, null);

/**
 * TabRouter
 */

const tabRouter = TabRouter(innerRouteConfig);
const tabNavigateAction = {
  type: "Navigation/NAVIGATE",
  routeName: "Test1",
};
tabRouter.getStateForAction(tabNavigateAction, null);

const fakeNavigateAction = {
  fake: "Navigation/NAVIGATE",
  blah: "Test1",
};
// $ExpectError not a valid action!
tabRouter.getStateForAction(fakeNavigateAction, null);
github agrcrobles / react-native-web-workspace / react-navigation-playground / js / CustomTabs.js View on Github external
return (
    
  );
};

const CustomTabRouter = TabRouter(
  {
    Home: {
      screen: MyHomeScreen,
      path: '',
    },
    Notifications: {
      screen: MyNotificationsScreen,
      path: 'notifications',
    },
    Settings: {
      screen: MySettingsScreen,
      path: 'settings',
    },
  },
  {
    // Change this to start on a different tab
github CodeRabbitYu / ShiTu / app / TestDemo.js View on Github external
return (
        
    )


};

const CustomTabRouter = TabRouter({
    Gank: {
        screen:Gank,
        navigationOptions: ()=> TabOptions('干货集中营',ShiTuIcon,ShiTuIcon,'干货集中营'),
    },
    ShiTu: {
        screen: ShiTu,
        navigationOptions: ()=> TabOptions('识兔',ShiTuIcon,ShiTuIcon,'识兔'),
    },
    Main:{
        screen:Main,
        navigationOptions: ()=> TabOptions('我的',ShiTuIcon,ShiTuIcon,'我的'),
    },
}, {
    // Change this to start on a different tab
    initialRouteName: 'ShiTu',
    tabBarPosition: 'bottom',
github react-navigation / react-navigation / example / src / CustomTabs.tsx View on Github external
class CustomTabView extends React.Component {
  render() {
    const { navigation, descriptors } = this.props;
    const { routes, index } = navigation.state;
    const descriptor = descriptors[routes[index].key];
    const ActiveScreen = descriptor.getComponent();
    return (
      
        
        
      
    );
  }
}

const CustomTabRouter = TabRouter(
  {
    Home: {
      path: '',
      screen: MyHomeScreen,
    },
    Notifications: {
      path: 'notifications',
      screen: MyNotificationsScreen,
    },
    Settings: {
      path: 'settings',
      screen: MySettingsScreen,
    },
  },
  {
    // Change this to start on a different tab
github kiok46 / duckduckgo / src / screens / HistoryScreen / HistoryTabRouter.js View on Github external
import {
  TabRouter,
} from 'react-navigation';
import RecentSearchesTab from './RecentSearchesTab';
import RecentStoriesTab from './RecentStoriesTab';

const HistoryTabRouter = TabRouter(
  {
    RecentStories: {
      screen: RecentStoriesTab,
      path: 'RecentStories',
    },
    RecentSearches: {
      screen: RecentSearchesTab,
      path: 'RecentSearches',
    }
  },
  {
    // Change this to start on a different tab
    initialRouteName: 'RecentStories',
  }
);
github kiok46 / duckduckgo / src / screens / FavouritesScreen / FavTabRouter.js View on Github external
import {
  TabRouter,
} from 'react-navigation';
import FavSearchesTab from './FavSearchesTab';
import FavStoriesTab from './FavStoriesTab';

const FavTabRouter = TabRouter(
  {
    FavStories: {
        screen: FavStoriesTab,
        path: 'FavStories',
    },
    FavSearches: {
      screen: FavSearchesTab,
      path: 'FavSearches',
    }

  },
  {
    // Change this to start on a different tab
    initialRouteName: 'FavStories',
  }
);
github srdjanprpa / FormulaOne / src / Circuit / CircuitContent.js View on Github external
)
}

CustomTabView.propTypes = {
  router: PropTypes.object.isRequired,
  navigation: PropTypes.object.isRequired,
  season: PropTypes.string.isRequired,
  round: PropTypes.string.isRequired,
  circuitId: PropTypes.string.isRequired,
  date: PropTypes.string,
  time: PropTypes.string
}

const CustomTabRouter = TabRouter(
  {
    Info: {
      screen: InfoScreen,
      path: '/info'
    },
    Qualifying: {
      screen: QualifyingScreen,
      path: '/qualifying'
    },
    Results: {
      screen: ResultsScreen,
      path: '/results'
    }
  },
  {
    // Change this to start on a different tab
github c-h- / universal-native-boilerplate / js / components / AppNavigator / TabNavigator.js View on Github external
export default (tabRoutes, options) => {
  const Router = TabRouter(tabRoutes, options);

  const AppNavigator = ({ navigation }) => {
    return (
      
    );
  };
  AppNavigator.router = Router;

  AppNavigator.propTypes = {
    navigation: PropTypes.object,
  };
github react-navigation / react-navigation / website / src / App.js View on Github external
doc: 'CONTRIBUTING',
        title: 'Contributors Guide',
        linkName: 'Contributors',
      }),
      path: 'contributors',
    },
  })
)(NavView);

GuidesDocs.navigationOptions = {
  linkName: 'Advanced Guides',
  icon: 'pt-icon-manual',
};

const NavigatorsDocs = createNavigator(
  TabRouter({
    Navigators: {
      screen: createDocPage({
        doc: 'api/navigators/Navigators',
        title: 'Intro to Navigators',
        linkName: 'Intro to Navigators',
      }),
      path: '',
    },
    StackNavigator: {
      screen: createDocPage({
        doc: 'api/navigators/StackNavigator',
        title: 'StackNavigator',
        linkName: 'StackNavigator',
      }),
      path: 'stack',
    },
github khle / easyRNRoute / app.js View on Github external
import ChatView from './Contents/chat';

const uiTheme = {
  palette: {
    primaryColor: COLOR.green500,
    accentColor: COLOR.pink500,
  },
  toolbar: {
    container: {
      height: 70,
      paddingTop: 20
    }
  }
}

const TabRoute = TabRouter({
  Today: { screen: TodayView },
  Profile: { screen: ProfileView },
  Map: { screen: MapView },
  Chat: {screen: ChatView}
  }, {
    initialRouteName: 'Today',
  }
);

class TabContentNavigator extends Component {
  constructor(props, context) {
    super(props, context);
    this.state = {
      active: props.value.active,
    };
  }