Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
React Router Quick Start Guide

You're reading from  React Router Quick Start Guide

Product type Book
Published in Sep 2018
Publisher Packt
ISBN-13 9781789532555
Pages 156 pages
Edition 1st Edition
Languages
Author (1):
Sagar Ganatra Sagar Ganatra
Profile icon Sagar Ganatra

Table of Contents (10) Chapters

Preface 1. Introduction to React Router 4 and Creating Your First Route 2. Configuring Routes - Using Various Options in the Route Component 3. Using the Link and NavLink Components to Navigate to a Route 4. Using the Redirect and Switch Components 5. Understanding the Core Router, and Configuring the BrowserRouter and HashRouter components 6. Using StaticRouter in a Server-Side Rendered React Application 7. Using NativeRouter in a React Native Application 8. Redux Bindings with connected-react-router 9. Other Books You May Enjoy

Summary

In this chapter, we looked at how the <Link> and <NavLink> navigation components can be used to navigate to various routes defined in the application. These components render anchor links in the page, and, when the user clicks on these links, sections of the page are updated as opposed to doing a complete page reload, thus providing a lucid user experience. The <Link> component accepts the props to, replace, and innerRef.

The <NavLink> component is similar to the <Link> component, and it accepts all the props that the <Link> component works with. In addition to adding a link to the page, the <NavLink> component accepts several props—activeClassName, activeStyle, exact, strict, and isActive.

To create links to the nested routes, the <Link> and <NavLink> components can use the prefix match.url in the to prop....

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}