File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ Methods
11
11
12
12
Adds a function to the location that should be called when it changes.
13
13
14
+ ### ` removeChangeListener(listener) `
15
+
16
+ Stop calling the given function when the location changes.
17
+
14
18
### ` push `
15
19
16
20
Called when the router is transitioning from one path to another.
@@ -33,21 +37,15 @@ This method should be ready to go immediately after setup.
33
37
34
38
Should return a useful string for logging and debugging.
35
39
36
- Example
40
+ History
37
41
-------
38
42
39
- For examples of how to implement your own location, please see the locations
40
- included in this repository.
43
+ Additionally, location objects must:
41
44
45
+ - Increment ` ReactRouter.History.length ` immediately ** after** the URL changes
46
+ - Decrement ` ReactRouter.History.length ` immediately ** before** going back to the
47
+ previous URL
42
48
43
- ``` js
44
- var MyLocation = {
45
- addChangeListener : function (listener ) {},
46
- push : function (path ) {},
47
- replace : function (path ) {},
48
- pop : function () {},
49
- getCurrentPath : function () {}
50
- };
49
+ Please refer to the [ built-in location objects] [ locations ] to get an idea for how this is done.
51
50
52
- Router .run (routes, MyLocation, callback);
53
- ```
51
+ [ locations ] : /modules/locations
You can’t perform that action at this time.
0 commit comments