Skip to content

Commit 9ace5fd

Browse files
committed
Merge pull request remix-run#2910 from taion/use-history-createLocation
Use history.createLocation where possible
2 parents e8451bd + 46147f1 commit 9ace5fd

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

modules/createTransitionManager.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ export default function createTransitionManager(history, routes) {
3434
location = { pathname: location, query: indexOnlyOrDeprecatedQuery }
3535
indexOnly = deprecatedIndexOnly || false
3636
} else {
37-
if (typeof location === 'string') {
38-
location = { pathname: location }
39-
}
37+
location = history.createLocation(location)
4038
indexOnly = indexOnlyOrDeprecatedQuery
4139
}
4240

modules/match.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ function match({ history, routes, location, ...options }, callback) {
3030

3131
if (location) {
3232
// Allow match({ location: '/the/path', ... })
33-
if (typeof location === 'string')
34-
location = history.createLocation(location)
33+
location = history.createLocation(location)
3534
} else {
3635
// Pick up the location from the history via synchronous history.listen
3736
// call if needed.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
"license": "MIT",
4040
"dependencies": {
41-
"history": "^2.0.0-rc2",
41+
"history": "^2.0.0-rc3",
4242
"invariant": "^2.0.0",
4343
"warning": "^2.0.0"
4444
},

0 commit comments

Comments
 (0)