react-router-dom 5.3.0 → 5.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) React Training 2015-2019
4
+ Copyright (c) Remix Software 2020-2022
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # react-router-dom
2
2
 
3
- DOM bindings for [React Router](https://reacttraining.com/react-router).
3
+ DOM bindings for [React Router](https://reactrouter.com).
4
4
 
5
5
  ## Installation
6
6
 
@@ -30,8 +30,8 @@ You can find the library on `window.ReactRouterDOM`.
30
30
 
31
31
  ## Issues
32
32
 
33
- If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues).
33
+ If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/remix-run/react-router/issues).
34
34
 
35
35
  ## Credits
36
36
 
37
- React Router is built and maintained by [React Training](https://reacttraining.com).
37
+ React Router is built and maintained by [Remix Software](https://remix.run).
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "react-router-dom",
3
- "version": "5.3.0",
3
+ "version": "5.3.3",
4
4
  "description": "DOM bindings for React Router",
5
- "repository": "ReactTraining/react-router",
5
+ "homepage": "https://reactrouter.com/",
6
+ "repository": {
7
+ "url": "https://github.com/remix-run/react-router.git",
8
+ "type": "git",
9
+ "directory": "packages/react-router-dom"
10
+ },
6
11
  "license": "MIT",
7
- "author": "React Training <hello@reacttraining.com>",
12
+ "author": "Remix Software <hello@remix.run>",
8
13
  "files": [
14
+ "LICENSE",
15
+ "README.md",
9
16
  "BrowserRouter.js",
10
17
  "HashRouter.js",
11
18
  "Link.js",
@@ -44,7 +51,7 @@
44
51
  "history": "^4.9.0",
45
52
  "loose-envify": "^1.3.1",
46
53
  "prop-types": "^15.6.2",
47
- "react-router": "5.2.1",
54
+ "react-router": "5.3.3",
48
55
  "tiny-invariant": "^1.0.2",
49
56
  "tiny-warning": "^1.0.0"
50
57
  },
@@ -2930,13 +2930,7 @@
2930
2930
 
2931
2931
  if (!props.staticContext) {
2932
2932
  _this.unlisten = props.history.listen(function (location) {
2933
- if (_this._isMounted) {
2934
- _this.setState({
2935
- location: location
2936
- });
2937
- } else {
2938
- _this._pendingLocation = location;
2939
- }
2933
+ _this._pendingLocation = location;
2940
2934
  });
2941
2935
  }
2942
2936
 
@@ -2946,8 +2940,26 @@
2946
2940
  var _proto = Router.prototype;
2947
2941
 
2948
2942
  _proto.componentDidMount = function componentDidMount() {
2943
+ var _this2 = this;
2944
+
2949
2945
  this._isMounted = true;
2950
2946
 
2947
+ if (this.unlisten) {
2948
+ // Any pre-mount location changes have been captured at
2949
+ // this point, so unregister the listener.
2950
+ this.unlisten();
2951
+ }
2952
+
2953
+ if (!this.props.staticContext) {
2954
+ this.unlisten = this.props.history.listen(function (location) {
2955
+ if (_this2._isMounted) {
2956
+ _this2.setState({
2957
+ location: location
2958
+ });
2959
+ }
2960
+ });
2961
+ }
2962
+
2951
2963
  if (this._pendingLocation) {
2952
2964
  this.setState({
2953
2965
  location: this._pendingLocation