react-router-dom 5.3.2 → 5.3.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router-dom",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.4",
|
|
4
4
|
"description": "DOM bindings for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com/",
|
|
6
6
|
"repository": {
|
|
@@ -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.
|
|
54
|
+
"react-router": "5.3.4",
|
|
55
55
|
"tiny-invariant": "^1.0.2",
|
|
56
56
|
"tiny-warning": "^1.0.0"
|
|
57
57
|
},
|
package/umd/react-router-dom.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = global || self, factory(global.ReactRouterDOM = {}, global.React));
|
|
5
5
|
}(this, function (exports, React) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
React = React && React.hasOwnProperty('default') ? React['default'] : React;
|
|
8
8
|
|
|
9
9
|
function _setPrototypeOf(o, p) {
|
|
10
10
|
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
@@ -2169,176 +2169,6 @@
|
|
|
2169
2169
|
return history;
|
|
2170
2170
|
}
|
|
2171
2171
|
|
|
2172
|
-
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
2173
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
|
|
2174
|
-
|
|
2175
|
-
function getUniqueId() {
|
|
2176
|
-
var key = '__global_unique_id__';
|
|
2177
|
-
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
function objectIs(x, y) {
|
|
2181
|
-
if (x === y) {
|
|
2182
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
2183
|
-
} else {
|
|
2184
|
-
return x !== x && y !== y;
|
|
2185
|
-
}
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
function createEventEmitter(value) {
|
|
2189
|
-
var handlers = [];
|
|
2190
|
-
return {
|
|
2191
|
-
on: function on(handler) {
|
|
2192
|
-
handlers.push(handler);
|
|
2193
|
-
},
|
|
2194
|
-
off: function off(handler) {
|
|
2195
|
-
handlers = handlers.filter(function (h) {
|
|
2196
|
-
return h !== handler;
|
|
2197
|
-
});
|
|
2198
|
-
},
|
|
2199
|
-
get: function get() {
|
|
2200
|
-
return value;
|
|
2201
|
-
},
|
|
2202
|
-
set: function set(newValue, changedBits) {
|
|
2203
|
-
value = newValue;
|
|
2204
|
-
handlers.forEach(function (handler) {
|
|
2205
|
-
return handler(value, changedBits);
|
|
2206
|
-
});
|
|
2207
|
-
}
|
|
2208
|
-
};
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
function onlyChild(children) {
|
|
2212
|
-
return Array.isArray(children) ? children[0] : children;
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
function createReactContext(defaultValue, calculateChangedBits) {
|
|
2216
|
-
var _Provider$childContex, _Consumer$contextType;
|
|
2217
|
-
|
|
2218
|
-
var contextProp = '__create-react-context-' + getUniqueId() + '__';
|
|
2219
|
-
|
|
2220
|
-
var Provider = /*#__PURE__*/function (_Component) {
|
|
2221
|
-
_inheritsLoose(Provider, _Component);
|
|
2222
|
-
|
|
2223
|
-
function Provider() {
|
|
2224
|
-
var _this;
|
|
2225
|
-
|
|
2226
|
-
_this = _Component.apply(this, arguments) || this;
|
|
2227
|
-
_this.emitter = createEventEmitter(_this.props.value);
|
|
2228
|
-
return _this;
|
|
2229
|
-
}
|
|
2230
|
-
|
|
2231
|
-
var _proto = Provider.prototype;
|
|
2232
|
-
|
|
2233
|
-
_proto.getChildContext = function getChildContext() {
|
|
2234
|
-
var _ref;
|
|
2235
|
-
|
|
2236
|
-
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
|
2237
|
-
};
|
|
2238
|
-
|
|
2239
|
-
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
2240
|
-
if (this.props.value !== nextProps.value) {
|
|
2241
|
-
var oldValue = this.props.value;
|
|
2242
|
-
var newValue = nextProps.value;
|
|
2243
|
-
var changedBits;
|
|
2244
|
-
|
|
2245
|
-
if (objectIs(oldValue, newValue)) {
|
|
2246
|
-
changedBits = 0;
|
|
2247
|
-
} else {
|
|
2248
|
-
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
2249
|
-
|
|
2250
|
-
{
|
|
2251
|
-
warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits);
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
changedBits |= 0;
|
|
2255
|
-
|
|
2256
|
-
if (changedBits !== 0) {
|
|
2257
|
-
this.emitter.set(nextProps.value, changedBits);
|
|
2258
|
-
}
|
|
2259
|
-
}
|
|
2260
|
-
}
|
|
2261
|
-
};
|
|
2262
|
-
|
|
2263
|
-
_proto.render = function render() {
|
|
2264
|
-
return this.props.children;
|
|
2265
|
-
};
|
|
2266
|
-
|
|
2267
|
-
return Provider;
|
|
2268
|
-
}(React.Component);
|
|
2269
|
-
|
|
2270
|
-
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = propTypes.object.isRequired, _Provider$childContex);
|
|
2271
|
-
|
|
2272
|
-
var Consumer = /*#__PURE__*/function (_Component2) {
|
|
2273
|
-
_inheritsLoose(Consumer, _Component2);
|
|
2274
|
-
|
|
2275
|
-
function Consumer() {
|
|
2276
|
-
var _this2;
|
|
2277
|
-
|
|
2278
|
-
_this2 = _Component2.apply(this, arguments) || this;
|
|
2279
|
-
_this2.state = {
|
|
2280
|
-
value: _this2.getValue()
|
|
2281
|
-
};
|
|
2282
|
-
|
|
2283
|
-
_this2.onUpdate = function (newValue, changedBits) {
|
|
2284
|
-
var observedBits = _this2.observedBits | 0;
|
|
2285
|
-
|
|
2286
|
-
if ((observedBits & changedBits) !== 0) {
|
|
2287
|
-
_this2.setState({
|
|
2288
|
-
value: _this2.getValue()
|
|
2289
|
-
});
|
|
2290
|
-
}
|
|
2291
|
-
};
|
|
2292
|
-
|
|
2293
|
-
return _this2;
|
|
2294
|
-
}
|
|
2295
|
-
|
|
2296
|
-
var _proto2 = Consumer.prototype;
|
|
2297
|
-
|
|
2298
|
-
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
2299
|
-
var observedBits = nextProps.observedBits;
|
|
2300
|
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
2301
|
-
};
|
|
2302
|
-
|
|
2303
|
-
_proto2.componentDidMount = function componentDidMount() {
|
|
2304
|
-
if (this.context[contextProp]) {
|
|
2305
|
-
this.context[contextProp].on(this.onUpdate);
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
var observedBits = this.props.observedBits;
|
|
2309
|
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
|
2310
|
-
};
|
|
2311
|
-
|
|
2312
|
-
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
2313
|
-
if (this.context[contextProp]) {
|
|
2314
|
-
this.context[contextProp].off(this.onUpdate);
|
|
2315
|
-
}
|
|
2316
|
-
};
|
|
2317
|
-
|
|
2318
|
-
_proto2.getValue = function getValue() {
|
|
2319
|
-
if (this.context[contextProp]) {
|
|
2320
|
-
return this.context[contextProp].get();
|
|
2321
|
-
} else {
|
|
2322
|
-
return defaultValue;
|
|
2323
|
-
}
|
|
2324
|
-
};
|
|
2325
|
-
|
|
2326
|
-
_proto2.render = function render() {
|
|
2327
|
-
return onlyChild(this.props.children)(this.state.value);
|
|
2328
|
-
};
|
|
2329
|
-
|
|
2330
|
-
return Consumer;
|
|
2331
|
-
}(React.Component);
|
|
2332
|
-
|
|
2333
|
-
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = propTypes.object, _Consumer$contextType);
|
|
2334
|
-
return {
|
|
2335
|
-
Provider: Provider,
|
|
2336
|
-
Consumer: Consumer
|
|
2337
|
-
};
|
|
2338
|
-
}
|
|
2339
|
-
|
|
2340
|
-
var index = React__default.createContext || createReactContext;
|
|
2341
|
-
|
|
2342
2172
|
var isarray = Array.isArray || function (arr) {
|
|
2343
2173
|
return Object.prototype.toString.call(arr) == '[object Array]';
|
|
2344
2174
|
};
|
|
@@ -2889,8 +2719,197 @@
|
|
|
2889
2719
|
|
|
2890
2720
|
var hoistNonReactStatics_cjs = hoistNonReactStatics;
|
|
2891
2721
|
|
|
2722
|
+
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
|
2723
|
+
var commonjsGlobal = typeof globalThis !== "undefined" // 'global proper'
|
|
2724
|
+
? // eslint-disable-next-line no-undef
|
|
2725
|
+
globalThis : typeof window !== "undefined" ? window // Browser
|
|
2726
|
+
: typeof global !== "undefined" ? global // node.js
|
|
2727
|
+
: {};
|
|
2728
|
+
|
|
2729
|
+
function getUniqueId() {
|
|
2730
|
+
var key = "__global_unique_id__";
|
|
2731
|
+
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
|
|
2732
|
+
} // Inlined Object.is polyfill.
|
|
2733
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
2734
|
+
|
|
2735
|
+
|
|
2736
|
+
function objectIs(x, y) {
|
|
2737
|
+
if (x === y) {
|
|
2738
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
2739
|
+
} else {
|
|
2740
|
+
// eslint-disable-next-line no-self-compare
|
|
2741
|
+
return x !== x && y !== y;
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
function createEventEmitter(value) {
|
|
2746
|
+
var handlers = [];
|
|
2747
|
+
return {
|
|
2748
|
+
on: function on(handler) {
|
|
2749
|
+
handlers.push(handler);
|
|
2750
|
+
},
|
|
2751
|
+
off: function off(handler) {
|
|
2752
|
+
handlers = handlers.filter(function (h) {
|
|
2753
|
+
return h !== handler;
|
|
2754
|
+
});
|
|
2755
|
+
},
|
|
2756
|
+
get: function get() {
|
|
2757
|
+
return value;
|
|
2758
|
+
},
|
|
2759
|
+
set: function set(newValue, changedBits) {
|
|
2760
|
+
value = newValue;
|
|
2761
|
+
handlers.forEach(function (handler) {
|
|
2762
|
+
return handler(value, changedBits);
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
function onlyChild(children) {
|
|
2769
|
+
return Array.isArray(children) ? children[0] : children;
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
function createReactContext(defaultValue, calculateChangedBits) {
|
|
2773
|
+
var _Provider$childContex, _Consumer$contextType;
|
|
2774
|
+
|
|
2775
|
+
var contextProp = "__create-react-context-" + getUniqueId() + "__";
|
|
2776
|
+
|
|
2777
|
+
var Provider = /*#__PURE__*/function (_React$Component) {
|
|
2778
|
+
_inheritsLoose(Provider, _React$Component);
|
|
2779
|
+
|
|
2780
|
+
function Provider() {
|
|
2781
|
+
var _this;
|
|
2782
|
+
|
|
2783
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2784
|
+
args[_key] = arguments[_key];
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
2788
|
+
_this.emitter = createEventEmitter(_this.props.value);
|
|
2789
|
+
return _this;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
var _proto = Provider.prototype;
|
|
2793
|
+
|
|
2794
|
+
_proto.getChildContext = function getChildContext() {
|
|
2795
|
+
var _ref;
|
|
2796
|
+
|
|
2797
|
+
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
2801
|
+
if (this.props.value !== nextProps.value) {
|
|
2802
|
+
var oldValue = this.props.value;
|
|
2803
|
+
var newValue = nextProps.value;
|
|
2804
|
+
var changedBits;
|
|
2805
|
+
|
|
2806
|
+
if (objectIs(oldValue, newValue)) {
|
|
2807
|
+
changedBits = 0; // No change
|
|
2808
|
+
} else {
|
|
2809
|
+
changedBits = typeof calculateChangedBits === "function" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
|
2810
|
+
|
|
2811
|
+
{
|
|
2812
|
+
warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, "calculateChangedBits: Expected the return value to be a " + "31-bit integer. Instead received: " + changedBits) ;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
changedBits |= 0;
|
|
2816
|
+
|
|
2817
|
+
if (changedBits !== 0) {
|
|
2818
|
+
this.emitter.set(nextProps.value, changedBits);
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
_proto.render = function render() {
|
|
2825
|
+
return this.props.children;
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2828
|
+
return Provider;
|
|
2829
|
+
}(React.Component);
|
|
2830
|
+
|
|
2831
|
+
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = propTypes.object.isRequired, _Provider$childContex);
|
|
2832
|
+
|
|
2833
|
+
var Consumer = /*#__PURE__*/function (_React$Component2) {
|
|
2834
|
+
_inheritsLoose(Consumer, _React$Component2);
|
|
2835
|
+
|
|
2836
|
+
function Consumer() {
|
|
2837
|
+
var _this2;
|
|
2838
|
+
|
|
2839
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2840
|
+
args[_key2] = arguments[_key2];
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
_this2 = _React$Component2.call.apply(_React$Component2, [this].concat(args)) || this;
|
|
2844
|
+
_this2.observedBits = void 0;
|
|
2845
|
+
_this2.state = {
|
|
2846
|
+
value: _this2.getValue()
|
|
2847
|
+
};
|
|
2848
|
+
|
|
2849
|
+
_this2.onUpdate = function (newValue, changedBits) {
|
|
2850
|
+
var observedBits = _this2.observedBits | 0;
|
|
2851
|
+
|
|
2852
|
+
if ((observedBits & changedBits) !== 0) {
|
|
2853
|
+
_this2.setState({
|
|
2854
|
+
value: _this2.getValue()
|
|
2855
|
+
});
|
|
2856
|
+
}
|
|
2857
|
+
};
|
|
2858
|
+
|
|
2859
|
+
return _this2;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
var _proto2 = Consumer.prototype;
|
|
2863
|
+
|
|
2864
|
+
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
2865
|
+
var observedBits = nextProps.observedBits;
|
|
2866
|
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
|
|
2867
|
+
: observedBits;
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2870
|
+
_proto2.componentDidMount = function componentDidMount() {
|
|
2871
|
+
if (this.context[contextProp]) {
|
|
2872
|
+
this.context[contextProp].on(this.onUpdate);
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
var observedBits = this.props.observedBits;
|
|
2876
|
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
|
|
2877
|
+
: observedBits;
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
_proto2.componentWillUnmount = function componentWillUnmount() {
|
|
2881
|
+
if (this.context[contextProp]) {
|
|
2882
|
+
this.context[contextProp].off(this.onUpdate);
|
|
2883
|
+
}
|
|
2884
|
+
};
|
|
2885
|
+
|
|
2886
|
+
_proto2.getValue = function getValue() {
|
|
2887
|
+
if (this.context[contextProp]) {
|
|
2888
|
+
return this.context[contextProp].get();
|
|
2889
|
+
} else {
|
|
2890
|
+
return defaultValue;
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
|
|
2894
|
+
_proto2.render = function render() {
|
|
2895
|
+
return onlyChild(this.props.children)(this.state.value);
|
|
2896
|
+
};
|
|
2897
|
+
|
|
2898
|
+
return Consumer;
|
|
2899
|
+
}(React.Component);
|
|
2900
|
+
|
|
2901
|
+
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = propTypes.object, _Consumer$contextType);
|
|
2902
|
+
return {
|
|
2903
|
+
Provider: Provider,
|
|
2904
|
+
Consumer: Consumer
|
|
2905
|
+
};
|
|
2906
|
+
} // MIT License
|
|
2907
|
+
|
|
2908
|
+
|
|
2909
|
+
var createContext = React.createContext || createReactContext; // TODO: Replace with React.createContext once we can assume React 16+
|
|
2910
|
+
|
|
2892
2911
|
var createNamedContext = function createNamedContext(name) {
|
|
2893
|
-
var context =
|
|
2912
|
+
var context = createContext();
|
|
2894
2913
|
context.displayName = name;
|
|
2895
2914
|
return context;
|
|
2896
2915
|
};
|
|
@@ -2976,21 +2995,21 @@
|
|
|
2976
2995
|
};
|
|
2977
2996
|
|
|
2978
2997
|
_proto.render = function render() {
|
|
2979
|
-
return /*#__PURE__*/
|
|
2998
|
+
return /*#__PURE__*/React.createElement(context.Provider, {
|
|
2980
2999
|
value: {
|
|
2981
3000
|
history: this.props.history,
|
|
2982
3001
|
location: this.state.location,
|
|
2983
3002
|
match: Router.computeRootMatch(this.state.location.pathname),
|
|
2984
3003
|
staticContext: this.props.staticContext
|
|
2985
3004
|
}
|
|
2986
|
-
}, /*#__PURE__*/
|
|
3005
|
+
}, /*#__PURE__*/React.createElement(historyContext.Provider, {
|
|
2987
3006
|
children: this.props.children || null,
|
|
2988
3007
|
value: this.props.history
|
|
2989
3008
|
}));
|
|
2990
3009
|
};
|
|
2991
3010
|
|
|
2992
3011
|
return Router;
|
|
2993
|
-
}(
|
|
3012
|
+
}(React.Component);
|
|
2994
3013
|
|
|
2995
3014
|
{
|
|
2996
3015
|
Router.propTypes = {
|
|
@@ -3026,14 +3045,14 @@
|
|
|
3026
3045
|
var _proto = MemoryRouter.prototype;
|
|
3027
3046
|
|
|
3028
3047
|
_proto.render = function render() {
|
|
3029
|
-
return /*#__PURE__*/
|
|
3048
|
+
return /*#__PURE__*/React.createElement(Router, {
|
|
3030
3049
|
history: this.history,
|
|
3031
3050
|
children: this.props.children
|
|
3032
3051
|
});
|
|
3033
3052
|
};
|
|
3034
3053
|
|
|
3035
3054
|
return MemoryRouter;
|
|
3036
|
-
}(
|
|
3055
|
+
}(React.Component);
|
|
3037
3056
|
|
|
3038
3057
|
{
|
|
3039
3058
|
MemoryRouter.propTypes = {
|
|
@@ -3075,7 +3094,7 @@
|
|
|
3075
3094
|
};
|
|
3076
3095
|
|
|
3077
3096
|
return Lifecycle;
|
|
3078
|
-
}(
|
|
3097
|
+
}(React.Component);
|
|
3079
3098
|
/**
|
|
3080
3099
|
* The public API for prompting the user before navigating away from a screen.
|
|
3081
3100
|
*/
|
|
@@ -3085,11 +3104,11 @@
|
|
|
3085
3104
|
var message = _ref.message,
|
|
3086
3105
|
_ref$when = _ref.when,
|
|
3087
3106
|
when = _ref$when === void 0 ? true : _ref$when;
|
|
3088
|
-
return /*#__PURE__*/
|
|
3107
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3089
3108
|
!context ? invariant(false, "You should not use <Prompt> outside a <Router>") : void 0;
|
|
3090
3109
|
if (!when || context.staticContext) return null;
|
|
3091
3110
|
var method = context.history.block;
|
|
3092
|
-
return /*#__PURE__*/
|
|
3111
|
+
return /*#__PURE__*/React.createElement(Lifecycle, {
|
|
3093
3112
|
onMount: function onMount(self) {
|
|
3094
3113
|
self.release = method(message);
|
|
3095
3114
|
},
|
|
@@ -3158,7 +3177,7 @@
|
|
|
3158
3177
|
to = _ref.to,
|
|
3159
3178
|
_ref$push = _ref.push,
|
|
3160
3179
|
push = _ref$push === void 0 ? false : _ref$push;
|
|
3161
|
-
return /*#__PURE__*/
|
|
3180
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3162
3181
|
!context ? invariant(false, "You should not use <Redirect> outside a <Router>") : void 0;
|
|
3163
3182
|
var history = context.history,
|
|
3164
3183
|
staticContext = context.staticContext;
|
|
@@ -3173,7 +3192,7 @@
|
|
|
3173
3192
|
return null;
|
|
3174
3193
|
}
|
|
3175
3194
|
|
|
3176
|
-
return /*#__PURE__*/
|
|
3195
|
+
return /*#__PURE__*/React.createElement(Lifecycle, {
|
|
3177
3196
|
onMount: function onMount() {
|
|
3178
3197
|
method(location);
|
|
3179
3198
|
},
|
|
@@ -3280,7 +3299,7 @@
|
|
|
3280
3299
|
}
|
|
3281
3300
|
|
|
3282
3301
|
function isEmptyChildren(children) {
|
|
3283
|
-
return
|
|
3302
|
+
return React.Children.count(children) === 0;
|
|
3284
3303
|
}
|
|
3285
3304
|
|
|
3286
3305
|
function evalChildrenDev(children, props, path) {
|
|
@@ -3305,7 +3324,7 @@
|
|
|
3305
3324
|
_proto.render = function render() {
|
|
3306
3325
|
var _this = this;
|
|
3307
3326
|
|
|
3308
|
-
return /*#__PURE__*/
|
|
3327
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context$1) {
|
|
3309
3328
|
!context$1 ? invariant(false, "You should not use <Route> outside a <Router>") : void 0;
|
|
3310
3329
|
var location = _this.props.location || context$1.location;
|
|
3311
3330
|
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
|
@@ -3326,14 +3345,14 @@
|
|
|
3326
3345
|
children = null;
|
|
3327
3346
|
}
|
|
3328
3347
|
|
|
3329
|
-
return /*#__PURE__*/
|
|
3348
|
+
return /*#__PURE__*/React.createElement(context.Provider, {
|
|
3330
3349
|
value: props
|
|
3331
|
-
}, props.match ? children ? typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : children : component ? /*#__PURE__*/
|
|
3350
|
+
}, props.match ? children ? typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : children : component ? /*#__PURE__*/React.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : null);
|
|
3332
3351
|
});
|
|
3333
3352
|
};
|
|
3334
3353
|
|
|
3335
3354
|
return Route;
|
|
3336
|
-
}(
|
|
3355
|
+
}(React.Component);
|
|
3337
3356
|
|
|
3338
3357
|
{
|
|
3339
3358
|
Route.propTypes = {
|
|
@@ -3470,14 +3489,14 @@
|
|
|
3470
3489
|
listen: this.handleListen,
|
|
3471
3490
|
block: this.handleBlock
|
|
3472
3491
|
};
|
|
3473
|
-
return /*#__PURE__*/
|
|
3492
|
+
return /*#__PURE__*/React.createElement(Router, _extends({}, rest, {
|
|
3474
3493
|
history: history,
|
|
3475
3494
|
staticContext: context
|
|
3476
3495
|
}));
|
|
3477
3496
|
};
|
|
3478
3497
|
|
|
3479
3498
|
return StaticRouter;
|
|
3480
|
-
}(
|
|
3499
|
+
}(React.Component);
|
|
3481
3500
|
|
|
3482
3501
|
{
|
|
3483
3502
|
StaticRouter.propTypes = {
|
|
@@ -3507,7 +3526,7 @@
|
|
|
3507
3526
|
_proto.render = function render() {
|
|
3508
3527
|
var _this = this;
|
|
3509
3528
|
|
|
3510
|
-
return /*#__PURE__*/
|
|
3529
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3511
3530
|
!context ? invariant(false, "You should not use <Switch> outside a <Router>") : void 0;
|
|
3512
3531
|
var location = _this.props.location || context.location;
|
|
3513
3532
|
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
|
@@ -3515,8 +3534,8 @@
|
|
|
3515
3534
|
// to trigger an unmount/remount for two <Route>s that render the same
|
|
3516
3535
|
// component at different URLs.
|
|
3517
3536
|
|
|
3518
|
-
|
|
3519
|
-
if (match == null && /*#__PURE__*/
|
|
3537
|
+
React.Children.forEach(_this.props.children, function (child) {
|
|
3538
|
+
if (match == null && /*#__PURE__*/React.isValidElement(child)) {
|
|
3520
3539
|
element = child;
|
|
3521
3540
|
var path = child.props.path || child.props.from;
|
|
3522
3541
|
match = path ? matchPath(location.pathname, _extends({}, child.props, {
|
|
@@ -3524,7 +3543,7 @@
|
|
|
3524
3543
|
})) : context.match;
|
|
3525
3544
|
}
|
|
3526
3545
|
});
|
|
3527
|
-
return match ? /*#__PURE__*/
|
|
3546
|
+
return match ? /*#__PURE__*/React.cloneElement(element, {
|
|
3528
3547
|
location: location,
|
|
3529
3548
|
computedMatch: match
|
|
3530
3549
|
}) : null;
|
|
@@ -3532,7 +3551,7 @@
|
|
|
3532
3551
|
};
|
|
3533
3552
|
|
|
3534
3553
|
return Switch;
|
|
3535
|
-
}(
|
|
3554
|
+
}(React.Component);
|
|
3536
3555
|
|
|
3537
3556
|
{
|
|
3538
3557
|
Switch.propTypes = {
|
|
@@ -3557,9 +3576,9 @@
|
|
|
3557
3576
|
var wrappedComponentRef = props.wrappedComponentRef,
|
|
3558
3577
|
remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
|
|
3559
3578
|
|
|
3560
|
-
return /*#__PURE__*/
|
|
3579
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3561
3580
|
!context ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : void 0;
|
|
3562
|
-
return /*#__PURE__*/
|
|
3581
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, remainingProps, context, {
|
|
3563
3582
|
ref: wrappedComponentRef
|
|
3564
3583
|
}));
|
|
3565
3584
|
});
|
|
@@ -3577,7 +3596,7 @@
|
|
|
3577
3596
|
return hoistNonReactStatics_cjs(C, Component);
|
|
3578
3597
|
}
|
|
3579
3598
|
|
|
3580
|
-
var useContext =
|
|
3599
|
+
var useContext = React.useContext;
|
|
3581
3600
|
|
|
3582
3601
|
function useHistory() {
|
|
3583
3602
|
{
|
|
@@ -3658,14 +3677,14 @@
|
|
|
3658
3677
|
var _proto = BrowserRouter.prototype;
|
|
3659
3678
|
|
|
3660
3679
|
_proto.render = function render() {
|
|
3661
|
-
return /*#__PURE__*/
|
|
3680
|
+
return /*#__PURE__*/React.createElement(Router, {
|
|
3662
3681
|
history: this.history,
|
|
3663
3682
|
children: this.props.children
|
|
3664
3683
|
});
|
|
3665
3684
|
};
|
|
3666
3685
|
|
|
3667
3686
|
return BrowserRouter;
|
|
3668
|
-
}(
|
|
3687
|
+
}(React.Component);
|
|
3669
3688
|
|
|
3670
3689
|
{
|
|
3671
3690
|
BrowserRouter.propTypes = {
|
|
@@ -3703,14 +3722,14 @@
|
|
|
3703
3722
|
var _proto = HashRouter.prototype;
|
|
3704
3723
|
|
|
3705
3724
|
_proto.render = function render() {
|
|
3706
|
-
return /*#__PURE__*/
|
|
3725
|
+
return /*#__PURE__*/React.createElement(Router, {
|
|
3707
3726
|
history: this.history,
|
|
3708
3727
|
children: this.props.children
|
|
3709
3728
|
});
|
|
3710
3729
|
};
|
|
3711
3730
|
|
|
3712
3731
|
return HashRouter;
|
|
3713
|
-
}(
|
|
3732
|
+
}(React.Component);
|
|
3714
3733
|
|
|
3715
3734
|
{
|
|
3716
3735
|
HashRouter.propTypes = {
|
|
@@ -3736,7 +3755,7 @@
|
|
|
3736
3755
|
return C;
|
|
3737
3756
|
};
|
|
3738
3757
|
|
|
3739
|
-
var forwardRef =
|
|
3758
|
+
var forwardRef = React.forwardRef;
|
|
3740
3759
|
|
|
3741
3760
|
if (typeof forwardRef === "undefined") {
|
|
3742
3761
|
forwardRef = forwardRefShim;
|
|
@@ -3783,7 +3802,7 @@
|
|
|
3783
3802
|
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
|
|
3784
3803
|
|
|
3785
3804
|
|
|
3786
|
-
return /*#__PURE__*/
|
|
3805
|
+
return /*#__PURE__*/React.createElement("a", props);
|
|
3787
3806
|
});
|
|
3788
3807
|
|
|
3789
3808
|
{
|
|
@@ -3802,7 +3821,7 @@
|
|
|
3802
3821
|
innerRef = _ref2.innerRef,
|
|
3803
3822
|
rest = _objectWithoutPropertiesLoose(_ref2, ["component", "replace", "to", "innerRef"]);
|
|
3804
3823
|
|
|
3805
|
-
return /*#__PURE__*/
|
|
3824
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3806
3825
|
!context ? invariant(false, "You should not use <Link> outside a <Router>") : void 0;
|
|
3807
3826
|
var history = context.history;
|
|
3808
3827
|
var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
|
|
@@ -3825,7 +3844,7 @@
|
|
|
3825
3844
|
props.innerRef = innerRef;
|
|
3826
3845
|
}
|
|
3827
3846
|
|
|
3828
|
-
return /*#__PURE__*/
|
|
3847
|
+
return /*#__PURE__*/React.createElement(component, props);
|
|
3829
3848
|
});
|
|
3830
3849
|
});
|
|
3831
3850
|
|
|
@@ -3848,7 +3867,7 @@
|
|
|
3848
3867
|
return C;
|
|
3849
3868
|
};
|
|
3850
3869
|
|
|
3851
|
-
var forwardRef$1 =
|
|
3870
|
+
var forwardRef$1 = React.forwardRef;
|
|
3852
3871
|
|
|
3853
3872
|
if (typeof forwardRef$1 === "undefined") {
|
|
3854
3873
|
forwardRef$1 = forwardRefShim$1;
|
|
@@ -3885,7 +3904,7 @@
|
|
|
3885
3904
|
innerRef = _ref.innerRef,
|
|
3886
3905
|
rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
|
|
3887
3906
|
|
|
3888
|
-
return /*#__PURE__*/
|
|
3907
|
+
return /*#__PURE__*/React.createElement(context.Consumer, null, function (context) {
|
|
3889
3908
|
!context ? invariant(false, "You should not use <NavLink> outside a <Router>") : void 0;
|
|
3890
3909
|
var currentLocation = locationProp || context.location;
|
|
3891
3910
|
var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
|
|
@@ -3921,7 +3940,7 @@
|
|
|
3921
3940
|
props.innerRef = innerRef;
|
|
3922
3941
|
}
|
|
3923
3942
|
|
|
3924
|
-
return /*#__PURE__*/
|
|
3943
|
+
return /*#__PURE__*/React.createElement(Link, props);
|
|
3925
3944
|
});
|
|
3926
3945
|
});
|
|
3927
3946
|
|