Skip to content

Commit 4a770e8

Browse files
committed
[fixed] Using TestLocation without DOM
Fixes #692
1 parent 36829b9 commit 4a770e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/locations/TestLocation.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var TestLocation = {
2222

2323
history: [],
2424

25+
needsDOM: false,
26+
2527
addChangeListener: function (listener) {
2628
// TestLocation only ever supports a single listener at a time.
2729
_listener = listener;

modules/utils/createRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function createRouter(options) {
175175
);
176176
} else {
177177
invariant(
178-
canUseDOM,
178+
canUseDOM || location.needsDOM === false,
179179
'You cannot use %s without a DOM',
180180
location
181181
);

0 commit comments

Comments
 (0)