Reader small image

You're reading from  React Router Quick Start Guide

Product typeBook
Published inSep 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789532555
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Sagar Ganatra
Sagar Ganatra
author image
Sagar Ganatra

Sagar Ganatra is a frontend engineer and an architect from Bangalore, India. He has more than a decade of experience in developing web and mobile applications. He specializes in architecting projects using JavaScript and frameworks such as React, Angular, and Node. His previous books include Kendo UI Cookbook and Instant Kendo UI Mobile, both published by Packt Publishing. He also writes about frontend technologies in his blog, sagarganatra (dot) com.
Read more about Sagar Ganatra

Right arrow

Summary

In this chapter, we looked at how React Router's <NativeRouter> component can be used in a React Native application. The <NativeRouter> component is available in the react-router-native package, and it uses the <MemoryRouter> component internally, which is defined in the react-router package. The <NativeRouter> component accepts props: initialEntries, initialIndex, getUserConfirmation, keyLength, and children. Also, it provides a default implementation for the getUserConfirmation function, which uses React Native's Alert component to display a confirmation message. This confirmation message is shown when the <Prompt> component is included in the application and the user tries to navigate away from the current route.

The <BackButton> component in react-router-native is a wrapper around React Native's BackHandler class,...

lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
React Router Quick Start Guide
Published in: Sep 2018Publisher: PacktISBN-13: 9781789532555

Author (1)

author image
Sagar Ganatra

Sagar Ganatra is a frontend engineer and an architect from Bangalore, India. He has more than a decade of experience in developing web and mobile applications. He specializes in architecting projects using JavaScript and frameworks such as React, Angular, and Node. His previous books include Kendo UI Cookbook and Instant Kendo UI Mobile, both published by Packt Publishing. He also writes about frontend technologies in his blog, sagarganatra (dot) com.
Read more about Sagar Ganatra