File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010For 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 )
Original file line number Diff line number Diff line change 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 ) .
You can’t perform that action at this time.
0 commit comments