Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Transitioning between screens

Transitioning between screens in React Native also works a bit differently than in the browser because again, there are no URLs. Instead, you need to use the navigation prop, which is available from components that are rendered by the stack navigator. The navigation prop can be used to handle routing by making the following changes:

  1. You can access the navigation prop in this example from the Home and Detail components:
import React from 'react';import { StyleSheet, Text, View } from 'react-native';import { createAppContainer } from 'react-navigation';import { createStackNavigator } from 'react-navigation-stack';- const Home = () => (+ const Home = ({ navigation }) => (  <View style={styles.container}> <Text>Open ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content