UNPKG

25 kBJavaScriptView Raw
1'use strict';
2
3function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
5var React = _interopDefault(require('react'));
6var PropTypes = _interopDefault(require('prop-types'));
7var history = require('history');
8var warning = _interopDefault(require('tiny-warning'));
9var createContext = _interopDefault(require('mini-create-react-context'));
10var invariant = _interopDefault(require('tiny-invariant'));
11var pathToRegexp = _interopDefault(require('path-to-regexp'));
12var reactIs = require('react-is');
13var hoistStatics = _interopDefault(require('hoist-non-react-statics'));
14
15function _extends() {
16 _extends = Object.assign || function (target) {
17 for (var i = 1; i < arguments.length; i++) {
18 var source = arguments[i];
19
20 for (var key in source) {
21 if (Object.prototype.hasOwnProperty.call(source, key)) {
22 target[key] = source[key];
23 }
24 }
25 }
26
27 return target;
28 };
29
30 return _extends.apply(this, arguments);
31}
32
33function _inheritsLoose(subClass, superClass) {
34 subClass.prototype = Object.create(superClass.prototype);
35 subClass.prototype.constructor = subClass;
36 subClass.__proto__ = superClass;
37}
38
39function _objectWithoutPropertiesLoose(source, excluded) {
40 if (source == null) return {};
41 var target = {};
42 var sourceKeys = Object.keys(source);
43 var key, i;
44
45 for (i = 0; i < sourceKeys.length; i++) {
46 key = sourceKeys[i];
47 if (excluded.indexOf(key) >= 0) continue;
48 target[key] = source[key];
49 }
50
51 return target;
52}
53
54// TODO: Replace with React.createContext once we can assume React 16+
55
56var createNamedContext = function createNamedContext(name) {
57 var context = createContext();
58 context.displayName = name;
59 return context;
60};
61
62var historyContext =
63/*#__PURE__*/
64createNamedContext("Router-History");
65
66// TODO: Replace with React.createContext once we can assume React 16+
67
68var createNamedContext$1 = function createNamedContext(name) {
69 var context = createContext();
70 context.displayName = name;
71 return context;
72};
73
74var context =
75/*#__PURE__*/
76createNamedContext$1("Router");
77
78/**
79 * The public API for putting history on context.
80 */
81
82var Router =
83/*#__PURE__*/
84function (_React$Component) {
85 _inheritsLoose(Router, _React$Component);
86
87 Router.computeRootMatch = function computeRootMatch(pathname) {
88 return {
89 path: "/",
90 url: "/",
91 params: {},
92 isExact: pathname === "/"
93 };
94 };
95
96 function Router(props) {
97 var _this;
98
99 _this = _React$Component.call(this, props) || this;
100 _this.state = {
101 location: props.history.location
102 }; // This is a bit of a hack. We have to start listening for location
103 // changes here in the constructor in case there are any <Redirect>s
104 // on the initial render. If there are, they will replace/push when
105 // they mount and since cDM fires in children before parents, we may
106 // get a new location before the <Router> is mounted.
107
108 _this._isMounted = false;
109 _this._pendingLocation = null;
110
111 if (!props.staticContext) {
112 _this.unlisten = props.history.listen(function (location) {
113 if (_this._isMounted) {
114 _this.setState({
115 location: location
116 });
117 } else {
118 _this._pendingLocation = location;
119 }
120 });
121 }
122
123 return _this;
124 }
125
126 var _proto = Router.prototype;
127
128 _proto.componentDidMount = function componentDidMount() {
129 this._isMounted = true;
130
131 if (this._pendingLocation) {
132 this.setState({
133 location: this._pendingLocation
134 });
135 }
136 };
137
138 _proto.componentWillUnmount = function componentWillUnmount() {
139 if (this.unlisten) this.unlisten();
140 };
141
142 _proto.render = function render() {
143 return React.createElement(context.Provider, {
144 value: {
145 history: this.props.history,
146 location: this.state.location,
147 match: Router.computeRootMatch(this.state.location.pathname),
148 staticContext: this.props.staticContext
149 }
150 }, React.createElement(historyContext.Provider, {
151 children: this.props.children || null,
152 value: this.props.history
153 }));
154 };
155
156 return Router;
157}(React.Component);
158
159{
160 Router.propTypes = {
161 children: PropTypes.node,
162 history: PropTypes.object.isRequired,
163 staticContext: PropTypes.object
164 };
165
166 Router.prototype.componentDidUpdate = function (prevProps) {
167 warning(prevProps.history === this.props.history, "You cannot change <Router history>") ;
168 };
169}
170
171/**
172 * The public API for a <Router> that stores location in memory.
173 */
174
175var MemoryRouter =
176/*#__PURE__*/
177function (_React$Component) {
178 _inheritsLoose(MemoryRouter, _React$Component);
179
180 function MemoryRouter() {
181 var _this;
182
183 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
184 args[_key] = arguments[_key];
185 }
186
187 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
188 _this.history = history.createMemoryHistory(_this.props);
189 return _this;
190 }
191
192 var _proto = MemoryRouter.prototype;
193
194 _proto.render = function render() {
195 return React.createElement(Router, {
196 history: this.history,
197 children: this.props.children
198 });
199 };
200
201 return MemoryRouter;
202}(React.Component);
203
204{
205 MemoryRouter.propTypes = {
206 initialEntries: PropTypes.array,
207 initialIndex: PropTypes.number,
208 getUserConfirmation: PropTypes.func,
209 keyLength: PropTypes.number,
210 children: PropTypes.node
211 };
212
213 MemoryRouter.prototype.componentDidMount = function () {
214 warning(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") ;
215 };
216}
217
218var Lifecycle =
219/*#__PURE__*/
220function (_React$Component) {
221 _inheritsLoose(Lifecycle, _React$Component);
222
223 function Lifecycle() {
224 return _React$Component.apply(this, arguments) || this;
225 }
226
227 var _proto = Lifecycle.prototype;
228
229 _proto.componentDidMount = function componentDidMount() {
230 if (this.props.onMount) this.props.onMount.call(this, this);
231 };
232
233 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
234 if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
235 };
236
237 _proto.componentWillUnmount = function componentWillUnmount() {
238 if (this.props.onUnmount) this.props.onUnmount.call(this, this);
239 };
240
241 _proto.render = function render() {
242 return null;
243 };
244
245 return Lifecycle;
246}(React.Component);
247
248/**
249 * The public API for prompting the user before navigating away from a screen.
250 */
251
252function Prompt(_ref) {
253 var message = _ref.message,
254 _ref$when = _ref.when,
255 when = _ref$when === void 0 ? true : _ref$when;
256 return React.createElement(context.Consumer, null, function (context) {
257 !context ? invariant(false, "You should not use <Prompt> outside a <Router>") : void 0;
258 if (!when || context.staticContext) return null;
259 var method = context.history.block;
260 return React.createElement(Lifecycle, {
261 onMount: function onMount(self) {
262 self.release = method(message);
263 },
264 onUpdate: function onUpdate(self, prevProps) {
265 if (prevProps.message !== message) {
266 self.release();
267 self.release = method(message);
268 }
269 },
270 onUnmount: function onUnmount(self) {
271 self.release();
272 },
273 message: message
274 });
275 });
276}
277
278{
279 var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
280 Prompt.propTypes = {
281 when: PropTypes.bool,
282 message: messageType.isRequired
283 };
284}
285
286var cache = {};
287var cacheLimit = 10000;
288var cacheCount = 0;
289
290function compilePath(path) {
291 if (cache[path]) return cache[path];
292 var generator = pathToRegexp.compile(path);
293
294 if (cacheCount < cacheLimit) {
295 cache[path] = generator;
296 cacheCount++;
297 }
298
299 return generator;
300}
301/**
302 * Public API for generating a URL pathname from a path and parameters.
303 */
304
305
306function generatePath(path, params) {
307 if (path === void 0) {
308 path = "/";
309 }
310
311 if (params === void 0) {
312 params = {};
313 }
314
315 return path === "/" ? path : compilePath(path)(params, {
316 pretty: true
317 });
318}
319
320/**
321 * The public API for navigating programmatically with a component.
322 */
323
324function Redirect(_ref) {
325 var computedMatch = _ref.computedMatch,
326 to = _ref.to,
327 _ref$push = _ref.push,
328 push = _ref$push === void 0 ? false : _ref$push;
329 return React.createElement(context.Consumer, null, function (context) {
330 !context ? invariant(false, "You should not use <Redirect> outside a <Router>") : void 0;
331 var history$1 = context.history,
332 staticContext = context.staticContext;
333 var method = push ? history$1.push : history$1.replace;
334 var location = history.createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, {
335 pathname: generatePath(to.pathname, computedMatch.params)
336 }) : to); // When rendering in a static context,
337 // set the new location immediately.
338
339 if (staticContext) {
340 method(location);
341 return null;
342 }
343
344 return React.createElement(Lifecycle, {
345 onMount: function onMount() {
346 method(location);
347 },
348 onUpdate: function onUpdate(self, prevProps) {
349 var prevLocation = history.createLocation(prevProps.to);
350
351 if (!history.locationsAreEqual(prevLocation, _extends({}, location, {
352 key: prevLocation.key
353 }))) {
354 method(location);
355 }
356 },
357 to: to
358 });
359 });
360}
361
362{
363 Redirect.propTypes = {
364 push: PropTypes.bool,
365 from: PropTypes.string,
366 to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired
367 };
368}
369
370var cache$1 = {};
371var cacheLimit$1 = 10000;
372var cacheCount$1 = 0;
373
374function compilePath$1(path, options) {
375 var cacheKey = "" + options.end + options.strict + options.sensitive;
376 var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
377 if (pathCache[path]) return pathCache[path];
378 var keys = [];
379 var regexp = pathToRegexp(path, keys, options);
380 var result = {
381 regexp: regexp,
382 keys: keys
383 };
384
385 if (cacheCount$1 < cacheLimit$1) {
386 pathCache[path] = result;
387 cacheCount$1++;
388 }
389
390 return result;
391}
392/**
393 * Public API for matching a URL pathname to a path.
394 */
395
396
397function matchPath(pathname, options) {
398 if (options === void 0) {
399 options = {};
400 }
401
402 if (typeof options === "string" || Array.isArray(options)) {
403 options = {
404 path: options
405 };
406 }
407
408 var _options = options,
409 path = _options.path,
410 _options$exact = _options.exact,
411 exact = _options$exact === void 0 ? false : _options$exact,
412 _options$strict = _options.strict,
413 strict = _options$strict === void 0 ? false : _options$strict,
414 _options$sensitive = _options.sensitive,
415 sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
416 var paths = [].concat(path);
417 return paths.reduce(function (matched, path) {
418 if (!path && path !== "") return null;
419 if (matched) return matched;
420
421 var _compilePath = compilePath$1(path, {
422 end: exact,
423 strict: strict,
424 sensitive: sensitive
425 }),
426 regexp = _compilePath.regexp,
427 keys = _compilePath.keys;
428
429 var match = regexp.exec(pathname);
430 if (!match) return null;
431 var url = match[0],
432 values = match.slice(1);
433 var isExact = pathname === url;
434 if (exact && !isExact) return null;
435 return {
436 path: path,
437 // the path used to match
438 url: path === "/" && url === "" ? "/" : url,
439 // the matched portion of the URL
440 isExact: isExact,
441 // whether or not we matched exactly
442 params: keys.reduce(function (memo, key, index) {
443 memo[key.name] = values[index];
444 return memo;
445 }, {})
446 };
447 }, null);
448}
449
450function isEmptyChildren(children) {
451 return React.Children.count(children) === 0;
452}
453
454function evalChildrenDev(children, props, path) {
455 var value = children(props);
456 warning(value !== undefined, "You returned `undefined` from the `children` function of " + ("<Route" + (path ? " path=\"" + path + "\"" : "") + ">, but you ") + "should have returned a React element or `null`") ;
457 return value || null;
458}
459/**
460 * The public API for matching a single path and rendering.
461 */
462
463
464var Route =
465/*#__PURE__*/
466function (_React$Component) {
467 _inheritsLoose(Route, _React$Component);
468
469 function Route() {
470 return _React$Component.apply(this, arguments) || this;
471 }
472
473 var _proto = Route.prototype;
474
475 _proto.render = function render() {
476 var _this = this;
477
478 return React.createElement(context.Consumer, null, function (context$1) {
479 !context$1 ? invariant(false, "You should not use <Route> outside a <Router>") : void 0;
480 var location = _this.props.location || context$1.location;
481 var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
482 : _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
483
484 var props = _extends({}, context$1, {
485 location: location,
486 match: match
487 });
488
489 var _this$props = _this.props,
490 children = _this$props.children,
491 component = _this$props.component,
492 render = _this$props.render; // Preact uses an empty array as children by
493 // default, so use null if that's the case.
494
495 if (Array.isArray(children) && children.length === 0) {
496 children = null;
497 }
498
499 return React.createElement(context.Provider, {
500 value: props
501 }, props.match ? children ? typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : children : component ? React.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? evalChildrenDev(children, props, _this.props.path) : null);
502 });
503 };
504
505 return Route;
506}(React.Component);
507
508{
509 Route.propTypes = {
510 children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
511 component: function component(props, propName) {
512 if (props[propName] && !reactIs.isValidElementType(props[propName])) {
513 return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component");
514 }
515 },
516 exact: PropTypes.bool,
517 location: PropTypes.object,
518 path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
519 render: PropTypes.func,
520 sensitive: PropTypes.bool,
521 strict: PropTypes.bool
522 };
523
524 Route.prototype.componentDidMount = function () {
525 warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored") ;
526 warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored") ;
527 warning(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored") ;
528 };
529
530 Route.prototype.componentDidUpdate = function (prevProps) {
531 warning(!(this.props.location && !prevProps.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') ;
532 warning(!(!this.props.location && prevProps.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') ;
533 };
534}
535
536function addLeadingSlash(path) {
537 return path.charAt(0) === "/" ? path : "/" + path;
538}
539
540function addBasename(basename, location) {
541 if (!basename) return location;
542 return _extends({}, location, {
543 pathname: addLeadingSlash(basename) + location.pathname
544 });
545}
546
547function stripBasename(basename, location) {
548 if (!basename) return location;
549 var base = addLeadingSlash(basename);
550 if (location.pathname.indexOf(base) !== 0) return location;
551 return _extends({}, location, {
552 pathname: location.pathname.substr(base.length)
553 });
554}
555
556function createURL(location) {
557 return typeof location === "string" ? location : history.createPath(location);
558}
559
560function staticHandler(methodName) {
561 return function () {
562 invariant(false, "You cannot %s with <StaticRouter>", methodName) ;
563 };
564}
565
566function noop() {}
567/**
568 * The public top-level API for a "static" <Router>, so-called because it
569 * can't actually change the current location. Instead, it just records
570 * location changes in a context object. Useful mainly in testing and
571 * server-rendering scenarios.
572 */
573
574
575var StaticRouter =
576/*#__PURE__*/
577function (_React$Component) {
578 _inheritsLoose(StaticRouter, _React$Component);
579
580 function StaticRouter() {
581 var _this;
582
583 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
584 args[_key] = arguments[_key];
585 }
586
587 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
588
589 _this.handlePush = function (location) {
590 return _this.navigateTo(location, "PUSH");
591 };
592
593 _this.handleReplace = function (location) {
594 return _this.navigateTo(location, "REPLACE");
595 };
596
597 _this.handleListen = function () {
598 return noop;
599 };
600
601 _this.handleBlock = function () {
602 return noop;
603 };
604
605 return _this;
606 }
607
608 var _proto = StaticRouter.prototype;
609
610 _proto.navigateTo = function navigateTo(location, action) {
611 var _this$props = this.props,
612 _this$props$basename = _this$props.basename,
613 basename = _this$props$basename === void 0 ? "" : _this$props$basename,
614 _this$props$context = _this$props.context,
615 context = _this$props$context === void 0 ? {} : _this$props$context;
616 context.action = action;
617 context.location = addBasename(basename, history.createLocation(location));
618 context.url = createURL(context.location);
619 };
620
621 _proto.render = function render() {
622 var _this$props2 = this.props,
623 _this$props2$basename = _this$props2.basename,
624 basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
625 _this$props2$context = _this$props2.context,
626 context = _this$props2$context === void 0 ? {} : _this$props2$context,
627 _this$props2$location = _this$props2.location,
628 location = _this$props2$location === void 0 ? "/" : _this$props2$location,
629 rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]);
630
631 var history$1 = {
632 createHref: function createHref(path) {
633 return addLeadingSlash(basename + createURL(path));
634 },
635 action: "POP",
636 location: stripBasename(basename, history.createLocation(location)),
637 push: this.handlePush,
638 replace: this.handleReplace,
639 go: staticHandler("go"),
640 goBack: staticHandler("goBack"),
641 goForward: staticHandler("goForward"),
642 listen: this.handleListen,
643 block: this.handleBlock
644 };
645 return React.createElement(Router, _extends({}, rest, {
646 history: history$1,
647 staticContext: context
648 }));
649 };
650
651 return StaticRouter;
652}(React.Component);
653
654{
655 StaticRouter.propTypes = {
656 basename: PropTypes.string,
657 context: PropTypes.object,
658 location: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
659 };
660
661 StaticRouter.prototype.componentDidMount = function () {
662 warning(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") ;
663 };
664}
665
666/**
667 * The public API for rendering the first <Route> that matches.
668 */
669
670var Switch =
671/*#__PURE__*/
672function (_React$Component) {
673 _inheritsLoose(Switch, _React$Component);
674
675 function Switch() {
676 return _React$Component.apply(this, arguments) || this;
677 }
678
679 var _proto = Switch.prototype;
680
681 _proto.render = function render() {
682 var _this = this;
683
684 return React.createElement(context.Consumer, null, function (context) {
685 !context ? invariant(false, "You should not use <Switch> outside a <Router>") : void 0;
686 var location = _this.props.location || context.location;
687 var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
688 // here because toArray adds keys to all child elements and we do not want
689 // to trigger an unmount/remount for two <Route>s that render the same
690 // component at different URLs.
691
692 React.Children.forEach(_this.props.children, function (child) {
693 if (match == null && React.isValidElement(child)) {
694 element = child;
695 var path = child.props.path || child.props.from;
696 match = path ? matchPath(location.pathname, _extends({}, child.props, {
697 path: path
698 })) : context.match;
699 }
700 });
701 return match ? React.cloneElement(element, {
702 location: location,
703 computedMatch: match
704 }) : null;
705 });
706 };
707
708 return Switch;
709}(React.Component);
710
711{
712 Switch.propTypes = {
713 children: PropTypes.node,
714 location: PropTypes.object
715 };
716
717 Switch.prototype.componentDidUpdate = function (prevProps) {
718 warning(!(this.props.location && !prevProps.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') ;
719 warning(!(!this.props.location && prevProps.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') ;
720 };
721}
722
723/**
724 * A public higher-order component to access the imperative API
725 */
726
727function withRouter(Component) {
728 var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
729
730 var C = function C(props) {
731 var wrappedComponentRef = props.wrappedComponentRef,
732 remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]);
733
734 return React.createElement(context.Consumer, null, function (context) {
735 !context ? invariant(false, "You should not use <" + displayName + " /> outside a <Router>") : void 0;
736 return React.createElement(Component, _extends({}, remainingProps, context, {
737 ref: wrappedComponentRef
738 }));
739 });
740 };
741
742 C.displayName = displayName;
743 C.WrappedComponent = Component;
744
745 {
746 C.propTypes = {
747 wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object])
748 };
749 }
750
751 return hoistStatics(C, Component);
752}
753
754var useContext = React.useContext;
755function useHistory() {
756 {
757 !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useHistory()") : void 0;
758 }
759
760 return useContext(historyContext);
761}
762function useLocation() {
763 {
764 !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useLocation()") : void 0;
765 }
766
767 return useContext(context).location;
768}
769function useParams() {
770 {
771 !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useParams()") : void 0;
772 }
773
774 var match = useContext(context).match;
775 return match ? match.params : {};
776}
777function useRouteMatch(path) {
778 {
779 !(typeof useContext === "function") ? invariant(false, "You must use React >= 16.8 in order to use useRouteMatch()") : void 0;
780 }
781
782 var location = useLocation();
783 var match = useContext(context).match;
784 return path ? matchPath(location.pathname, path) : match;
785}
786
787{
788 if (typeof window !== "undefined") {
789 var global = window;
790 var key = "__react_router_build__";
791 var buildNames = {
792 cjs: "CommonJS",
793 esm: "ES modules",
794 umd: "UMD"
795 };
796
797 if (global[key] && global[key] !== "cjs") {
798 var initialBuildName = buildNames[global[key]];
799 var secondaryBuildName = buildNames["cjs"]; // TODO: Add link to article that explains in detail how to avoid
800 // loading 2 different builds.
801
802 throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right.");
803 }
804
805 global[key] = "cjs";
806 }
807}
808
809exports.MemoryRouter = MemoryRouter;
810exports.Prompt = Prompt;
811exports.Redirect = Redirect;
812exports.Route = Route;
813exports.Router = Router;
814exports.StaticRouter = StaticRouter;
815exports.Switch = Switch;
816exports.__HistoryContext = historyContext;
817exports.__RouterContext = context;
818exports.generatePath = generatePath;
819exports.matchPath = matchPath;
820exports.useHistory = useHistory;
821exports.useLocation = useLocation;
822exports.useParams = useParams;
823exports.useRouteMatch = useRouteMatch;
824exports.withRouter = withRouter;
825//# sourceMappingURL=react-router.js.map