O'Reilly logo

React and React Native by Adam Boduch

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

Navigation bar

The previous example rendered navigation links as the main content. However, it's often better to place the navigation links in their own section. The Navigator component lets you specify a navigation bar. Let's try this out now, starting with the main module:

import React from 'react'; import { AppRegistry, Navigator, } from 'react-native'; import routes from './routes'; import styles from './styles'; // Renders the scene, the "navigator" property // is no longer needed here since navigation is // now handled separately. const renderScene = route => (<route.Scene />); // The composition of the navigation bar is three components: // "Title", "LeftButton", and "RightButton". These // components come from the "route". const routeMapper ...

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