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 the Redux library can be used to create a store to manage various state entities in the application. The store receives actions and the reducers alter the state of the application when an action is dispatched. The connected-react-router library provides Redux bindings for React Router and it includes a higher-order function, connectRouter, which wraps rootReducer and creates a router state. The connectRouter function is then used in the createStore function to make the router state available to the components in the application.

The <ConnectedRouter> component in connected-react-router listens to the changes in the history location and dispatches the LOCATION_CHANGE action to update the router state property. This router state property can then be read by the rendered route component by reading the state information from the store...

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