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

Responding to routes

Let's implement a simple UI with three scenes in it (remember, scenes are synonymous with pages). Each scene will link to the other two scenes so that you can actually navigate the application. Let's start with the main application module:

import React from 'react'; import { AppRegistry, Navigator, } from 'react-native'; import routes from './routes'; // Renders a scene. The "Scene" is a React component, and // is found as a property of the "route". The "navigator" // instance is passed to the scene as a property. const renderScene = (route, navigator) => ( <route.Scene navigator={navigator} /> ); // Renders a "<Navigator>" component. This is the root // component of the application because it manages // "scenes" that represent ...

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