GitHub - react-navigation/tabs: Tab navigators for React Navigation (original) (raw)

This package has been moved to https://github.com/react-navigation/react-navigation/tree/4.x


React Navigation Tabs

Build Status Version MIT License

Tab navigators for React Navigation.

Installation

Follow the instructions on the the React Navigation "Getting Started" guide, and then add the react-navigation-tabs package to your project.

Usage

The package exports two different navigators:

You can import individual navigators and use them:

import { createBottomTabNavigator } from 'react-navigation-tabs';

export default createBottomTabNavigator({ Album: { screen: Album }, Library: { screen: Library }, History: { screen: History }, Cart: { screen: Cart }, });

You can install another package, react-navigation-material-bottom-tabs, to use a third type of tab navigator:

import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';

export default createMaterialBottomTabNavigator( { Album: { screen: Album }, Library: { screen: Library }, History: { screen: History }, Cart: { screen: Cart }, }, { initialRouteName: 'Album', activeTintColor: '#F44336', }, );

Development workflow

To setup the development environment, open a Terminal in the repo directory and run the following:

While developing, you can run the example app with Expo to test your changes:

Make sure your code passes TypeScript and ESLint. Run the following to verify:

yarn typescript yarn lint

To fix formatting errors, run the following:

Docs