Skip to content

Commit 5de41a9

Browse files
committed
Add Sync Your react-router State With Redux as a react til
1 parent 22b29c0 commit 5de41a9

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For a steady stream of TILs from a variety of rocketeers, checkout
1111
[til.hashrocket.com](https://til.hashrocket.com/).
1212

13-
_665 TILs and counting..._
13+
_666 TILs and counting..._
1414

1515
---
1616

@@ -471,6 +471,7 @@ _665 TILs and counting..._
471471
- [Quickly Search For A Component With React DevTools](react/quickly-search-for-a-component-with-react-devtools.md)
472472
- [Read Only Input Elements](react/read-only-input-elements.md)
473473
- [Rendering Multiple Nodes With Fragments](react/rendering-multiple-nodes-with-fragments.md)
474+
- [Sync Your react-router State With Redux](react/sync-your-react-router-state-with-redux.md)
474475
- [Test Files In create-react-app](react/test-files-in-create-react-app.md)
475476
- [Upgrading To The Latest React In CodeSandbox](react/upgrading-to-the-latest-react-in-codesandbox.md)
476477
- [Use A Ref To Autofocus An Input](react/use-a-ref-to-autofocus-an-input.md)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Sync Your react-router State With Redux
2+
3+
If you are building a React app that uses both `redux` and `react-router`,
4+
you'll find that you are managing app state in two places. Most of your app
5+
state is in `redux`. The router-specific state is component-state in the
6+
`Router`.
7+
8+
You can unify it all in `redux` with
9+
[`react-router-redux`](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux).
10+
11+
You'll need to apply some middleware, combine `routerReducer` with the rest
12+
of your reducers, and then swap out your `BrowserRouter` with a
13+
`ConnectedRouter`. You can read about the details
14+
[here](https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux).

0 commit comments

Comments
 (0)