We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d52d55 commit f975bdfCopy full SHA for f975bdf
modules/createRouter.js
@@ -134,14 +134,15 @@ function createRouter(options) {
134
var pendingTransition = null;
135
var dispatchHandler = null;
136
137
- if (typeof location === 'string') {
+ if (typeof location === 'string')
138
+ location = new StaticLocation(location);
139
+
140
+ if (location instanceof StaticLocation) {
141
warning(
142
!canUseDOM || process.env.NODE_ENV === 'test',
143
'You should not use a static location in a DOM environment because ' +
144
'the router will not be kept in sync with the current URL'
145
);
-
- location = new StaticLocation(location);
146
} else {
147
invariant(
148
canUseDOM || location.needsDOM === false,
0 commit comments