Skip to content

Commit d30ec54

Browse files
committed
Merge pull request #2667 from taion/Link-history-1.15.x
Use history v1.15.x API for createHref
2 parents a9b9b05 + d9fb509 commit d30ec54

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

modules/Link.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function isEmptyObject(object) {
1919
return true
2020
}
2121

22-
function createLocation({ to, query, hash, state }) {
22+
function createLocationDescriptor({ to, query, hash, state }) {
2323
if (typeof to !== 'object') {
2424
return { pathname: to, query, hash, state }
2525
} else {
@@ -96,7 +96,7 @@ const Link = React.createClass({
9696
if (allowTransition) {
9797
let { state, to, query, hash } = this.props
9898

99-
const location = createLocation({ to, query, hash, state })
99+
const location = createLocationDescriptor({ to, query, hash, state })
100100

101101
this.context.history.push(location)
102102
}
@@ -113,9 +113,9 @@ const Link = React.createClass({
113113
const { history } = this.context
114114

115115
if (history) {
116-
const location = createLocation({ to, query, hash, state })
116+
const location = createLocationDescriptor({ to, query, hash, state })
117117

118-
props.href = history.createHref(location, location.query)
118+
props.href = history.createHref(location)
119119

120120
if (activeClassName || (activeStyle != null && !isEmptyObject(activeStyle))) {
121121
if (history.isActive(to, query, onlyActiveOnIndex)) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"warning": "^2.0.0"
4242
},
4343
"peerDependencies": {
44-
"history": "^1.14.0"
44+
"history": "^1.15.0"
4545
},
4646
"devDependencies": {
4747
"babel": "^5.4.7",
@@ -60,7 +60,7 @@
6060
"express": "^4.13.3",
6161
"express-urlrewrite": "^1.2.0",
6262
"gzip-size": "^3.0.0",
63-
"history": "^1.14.0",
63+
"history": "^1.15.0",
6464
"isparta-loader": "^1.0.0",
6565
"karma": "^0.13.13",
6666
"karma-browserstack-launcher": "^0.1.4",

0 commit comments

Comments
 (0)