O'Reilly logo

Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tab navigation

As we already have the bottom icon controls in place, it will be very straightforward to make them work. This is a classic example for tab navigation:

// src / Chapter 7 / Example 4 / src / screens / index.jsexport default createBottomTabNavigator(    {        Home: createStackNavigator({            TaskList: {                // ...            },            // ...        }, {            // ...        }),        Search: () => (            <View>                <Text>Search placeholder. Under construction.</Text>            </View>        ),        Notifications: () => (            <View>                <Text>Notifications placeholder. Under construction.</Text>            </View>        )    },    {        initialRouteName: 'Home',        initialRouteParams: {}    });

Please note the use of shorthand for creating screens. Instead of using an object, I pass the component directly:

By default, React Navigation will create a bottom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required