Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit 817e19a

Browse files
committed
Clarify connect problems.
1 parent 62f5b4c commit 817e19a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ That said, redux-router is a fine project and has features this doesn't provide.
3434

3535
### Usage
3636

37-
The idea of this library is to use react-router's functionality exactly like its documentation tells you to. You can access all of its APIs in routing components. Additionally, you can use redux like you normally would, with a single app state and "connected" components. It's even possible for a single component to be both if needed.
37+
The idea of this library is to use react-router's functionality exactly like its documentation tells you to. You can access all of its APIs in routing components. Additionally, you can use redux like you normally would, with a single app state.
3838

3939
[redux](https://github.com/rackt/redux) (`store.routing`)  ↔  [**redux-simple-router**](https://github.com/jlongster/redux-simple-router)  ↔  [history](https://github.com/rackt/history) (`history.location`)  ↔  [react-router](https://github.com/rackt/react-router)
4040

@@ -138,7 +138,9 @@ Call this on the middleware returned from `syncHistory` to stop the syncing proc
138138

139139
#### `routeReducer`
140140

141-
A reducer function that keeps track of the router state. You must to add this reducer to your app reducers when creating the store.
141+
A reducer function that keeps track of the router state. You must to add this reducer to your app reducers when creating the store. It will return a `location` property in state. If you use `combineReducers`, it will be nested under wherever you property you add it to (`state.routing` in the example above).
142+
143+
**Warning:** It is a bad pattern to use `react-redux`'s `connect` decorator to map the state from this reducer to props on your `Route` components. This can lead to infinite loops and performance problems. `react-router` already provides this for you via `this.props.location`.
142144

143145
#### `UPDATE_LOCATION`
144146

0 commit comments

Comments
 (0)