Skip to content

Commit a030648

Browse files
committed
[changed] Relaxed MemoryStore invariant
1 parent ccf4149 commit a030648

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/locations/MemoryLocation.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
var invariant = require('react/lib/invariant');
1+
var warning = require('react/lib/warning');
22

3-
var _lastPath;
4-
var _currentPath = '/';
3+
var _lastPath = null;
4+
var _currentPath = null;
55
var _onChange;
66

77
/**
@@ -25,7 +25,7 @@ var MemoryLocation = {
2525
},
2626

2727
pop: function () {
28-
invariant(
28+
warning(
2929
_lastPath != null,
3030
'You cannot use MemoryLocation to go back more than once'
3131
);
@@ -36,7 +36,7 @@ var MemoryLocation = {
3636
},
3737

3838
getCurrentPath: function () {
39-
return _currentPath;
39+
return _currentPath || '/';
4040
},
4141

4242
toString: function () {

0 commit comments

Comments
 (0)