react-router-dom 5.3.1 → 5.3.2

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) React Training
3
+ Copyright (c) React Training 2015-2019
4
+ Copyright (c) Remix Software 2020-2022
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -34,4 +34,4 @@ If you find a bug, please file an issue on [our issue tracker on GitHub](https:/
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,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router-dom",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "DOM bindings for React Router",
5
5
  "homepage": "https://reactrouter.com/",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/react-router-dom"
10
10
  },
11
11
  "license": "MIT",
12
- "author": "React Training <hello@reacttraining.com>",
12
+ "author": "Remix Software <hello@remix.run>",
13
13
  "files": [
14
14
  "LICENSE",
15
15
  "README.md",
@@ -51,7 +51,7 @@
51
51
  "history": "^4.9.0",
52
52
  "loose-envify": "^1.3.1",
53
53
  "prop-types": "^15.6.2",
54
- "react-router": "5.3.1",
54
+ "react-router": "5.3.2",
55
55
  "tiny-invariant": "^1.0.2",
56
56
  "tiny-warning": "^1.0.0"
57
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