December 2019
Intermediate to advanced
474 pages
10h 3m
English
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:
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 ...