Skip to content

Commit 6f8b39d

Browse files
author
Neal Granger
committed
Fix router route props application.
The props from the react router context were getting incorrectly merged with the component props.
1 parent 5e5f898 commit 6f8b39d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/router.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {setRouteComponents, setPreviousPath} from './action';
1212
export default (formatPattern) => {
1313
invariant(
1414
typeof formatPattern === 'function',
15-
'The `formatPattern` function from `react-redux` must be provided. ' +
16-
'Add `import {formatPattern} from "react-router"` and add it as the ' +
17-
'argument to your call to `createRelocationRouter`.'
15+
'The `formatPattern` function from `react-redux` must be provided. ' +
16+
'Add `import {formatPattern} from "react-router"` and add it as the ' +
17+
'argument to your call to `createRelocationRouter`.'
1818
);
1919

2020
const finalFormatPattern = typeof formatPattern === 'function' ?
@@ -41,7 +41,7 @@ export default (formatPattern) => {
4141
}
4242

4343
updateRouteComponents(props) {
44-
const {routes, params} = props;
44+
const {routes, params, location} = props;
4545
const {dispatch} = this.props;
4646

4747
if (this.routes === params && this.prams === params) {
@@ -82,9 +82,9 @@ export default (formatPattern) => {
8282

8383
// Merge component props with redux-router props.
8484
props: {
85-
...this.props,
86-
location: props.location,
87-
params: props.params,
85+
...relocation.props,
86+
location,
87+
params,
8888
},
8989

9090
// If `route.relocation` is a string, assign it the type. Otherwise

0 commit comments

Comments
 (0)