How to do it...

  1. Let's start by opening the App.js file. In this file, we'll be using the StackNavigator component provided by the react-navigation package. First, let's add the imports we'll be using in this file. HomeScreen is a component we will be building later in this recipe:
import React, { Component } from 'react';
import { StackNavigator } from 'react-navigation';

import HomeScreen from './HomeScreen';
  1. Now that we have our imports, let's use the StackNavigator component to define the first route; we'll be using a Home route with links that should be displayed using the React Native WebView component. The navigationOptions property allows us to define a title to be displayed in the navigation header:
const App = StackNavigator({ ...

Get React Native Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.