1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | (function (global, factory) {
|
12 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@remix-run/router'), require('react')) :
|
13 | typeof define === 'function' && define.amd ? define(['exports', '@remix-run/router', 'react'], factory) :
|
14 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouter = {}, global.RemixRouter, global.React));
|
15 | })(this, (function (exports, router, React) { 'use strict';
|
16 |
|
17 | function _interopNamespace(e) {
|
18 | if (e && e.__esModule) return e;
|
19 | var n = Object.create(null);
|
20 | if (e) {
|
21 | Object.keys(e).forEach(function (k) {
|
22 | if (k !== 'default') {
|
23 | var d = Object.getOwnPropertyDescriptor(e, k);
|
24 | Object.defineProperty(n, k, d.get ? d : {
|
25 | enumerable: true,
|
26 | get: function () { return e[k]; }
|
27 | });
|
28 | }
|
29 | });
|
30 | }
|
31 | n["default"] = e;
|
32 | return Object.freeze(n);
|
33 | }
|
34 |
|
35 | var React__namespace = _interopNamespace(React);
|
36 |
|
37 | function _extends() {
|
38 | _extends = Object.assign ? Object.assign.bind() : function (target) {
|
39 | for (var i = 1; i < arguments.length; i++) {
|
40 | var source = arguments[i];
|
41 |
|
42 | for (var key in source) {
|
43 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
44 | target[key] = source[key];
|
45 | }
|
46 | }
|
47 | }
|
48 |
|
49 | return target;
|
50 | };
|
51 | return _extends.apply(this, arguments);
|
52 | }
|
53 |
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 | function isPolyfill(x, y) {
|
66 | return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y
|
67 | ;
|
68 | }
|
69 |
|
70 | const is = typeof Object.is === "function" ? Object.is : isPolyfill;
|
71 |
|
72 |
|
73 | const {
|
74 | useState,
|
75 | useEffect,
|
76 | useLayoutEffect,
|
77 | useDebugValue
|
78 | } = React__namespace;
|
79 | let didWarnOld18Alpha = false;
|
80 | let didWarnUncachedGetSnapshot = false;
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | function useSyncExternalStore$2(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
92 | // React do not expose a way to check if we're hydrating. So users of the shim
|
93 |
|
94 |
|
95 | getServerSnapshot) {
|
96 | {
|
97 | if (!didWarnOld18Alpha) {
|
98 | if ("startTransition" in React__namespace) {
|
99 | didWarnOld18Alpha = true;
|
100 | console.error("You are using an outdated, pre-release alpha of React 18 that " + "does not support useSyncExternalStore. The " + "use-sync-external-store shim will not work correctly. Upgrade " + "to a newer pre-release.");
|
101 | }
|
102 | }
|
103 | }
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | const value = getSnapshot();
|
110 |
|
111 | {
|
112 | if (!didWarnUncachedGetSnapshot) {
|
113 | const cachedValue = getSnapshot();
|
114 |
|
115 | if (!is(value, cachedValue)) {
|
116 | console.error("The result of getSnapshot should be cached to avoid an infinite loop");
|
117 | didWarnUncachedGetSnapshot = true;
|
118 | }
|
119 | }
|
120 | }
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | const [{
|
137 | inst
|
138 | }, forceUpdate] = useState({
|
139 | inst: {
|
140 | value,
|
141 | getSnapshot
|
142 | }
|
143 | });
|
144 |
|
145 |
|
146 |
|
147 | useLayoutEffect(() => {
|
148 | inst.value = value;
|
149 | inst.getSnapshot = getSnapshot;
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | if (checkIfSnapshotChanged(inst)) {
|
155 |
|
156 | forceUpdate({
|
157 | inst
|
158 | });
|
159 | }
|
160 |
|
161 | }, [subscribe, value, getSnapshot]);
|
162 | useEffect(() => {
|
163 |
|
164 |
|
165 | if (checkIfSnapshotChanged(inst)) {
|
166 |
|
167 | forceUpdate({
|
168 | inst
|
169 | });
|
170 | }
|
171 |
|
172 | const handleStoreChange = () => {
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 | if (checkIfSnapshotChanged(inst)) {
|
180 |
|
181 | forceUpdate({
|
182 | inst
|
183 | });
|
184 | }
|
185 | };
|
186 |
|
187 |
|
188 | return subscribe(handleStoreChange);
|
189 | }, [subscribe]);
|
190 | useDebugValue(value);
|
191 | return value;
|
192 | }
|
193 |
|
194 | function checkIfSnapshotChanged(inst) {
|
195 | const latestGetSnapshot = inst.getSnapshot;
|
196 | const prevValue = inst.value;
|
197 |
|
198 | try {
|
199 | const nextValue = latestGetSnapshot();
|
200 | return !is(prevValue, nextValue);
|
201 | } catch (error) {
|
202 | return true;
|
203 | }
|
204 | }
|
205 |
|
206 | |
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | return getSnapshot();
|
220 | }
|
221 |
|
222 | |
223 |
|
224 |
|
225 |
|
226 |
|
227 | const canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
228 | const isServerEnvironment = !canUseDOM;
|
229 | const shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
230 | const useSyncExternalStore = "useSyncExternalStore" in React__namespace ? (module => module.useSyncExternalStore)(React__namespace) : shim;
|
231 |
|
232 |
|
233 | const DataStaticRouterContext = React__namespace.createContext(null);
|
234 |
|
235 | {
|
236 | DataStaticRouterContext.displayName = "DataStaticRouterContext";
|
237 | }
|
238 |
|
239 | const DataRouterContext = React__namespace.createContext(null);
|
240 |
|
241 | {
|
242 | DataRouterContext.displayName = "DataRouter";
|
243 | }
|
244 |
|
245 | const DataRouterStateContext = React__namespace.createContext(null);
|
246 |
|
247 | {
|
248 | DataRouterStateContext.displayName = "DataRouterState";
|
249 | }
|
250 |
|
251 | const AwaitContext = React__namespace.createContext(null);
|
252 |
|
253 | {
|
254 | AwaitContext.displayName = "Await";
|
255 | }
|
256 |
|
257 | const NavigationContext = React__namespace.createContext(null);
|
258 |
|
259 | {
|
260 | NavigationContext.displayName = "Navigation";
|
261 | }
|
262 |
|
263 | const LocationContext = React__namespace.createContext(null);
|
264 |
|
265 | {
|
266 | LocationContext.displayName = "Location";
|
267 | }
|
268 |
|
269 | const RouteContext = React__namespace.createContext({
|
270 | outlet: null,
|
271 | matches: []
|
272 | });
|
273 |
|
274 | {
|
275 | RouteContext.displayName = "Route";
|
276 | }
|
277 |
|
278 | const RouteErrorContext = React__namespace.createContext(null);
|
279 |
|
280 | {
|
281 | RouteErrorContext.displayName = "RouteError";
|
282 | }
|
283 |
|
284 | |
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 | function useHref(to, _temp) {
|
292 | let {
|
293 | relative
|
294 | } = _temp === void 0 ? {} : _temp;
|
295 | !useInRouterContext() ? router.invariant(false,
|
296 |
|
297 | "useHref() may be used only in the context of a <Router> component.") : void 0;
|
298 | let {
|
299 | basename,
|
300 | navigator
|
301 | } = React__namespace.useContext(NavigationContext);
|
302 | let {
|
303 | hash,
|
304 | pathname,
|
305 | search
|
306 | } = useResolvedPath(to, {
|
307 | relative
|
308 | });
|
309 | let joinedPathname = pathname;
|
310 |
|
311 |
|
312 |
|
313 |
|
314 | if (basename !== "/") {
|
315 | joinedPathname = pathname === "/" ? basename : router.joinPaths([basename, pathname]);
|
316 | }
|
317 |
|
318 | return navigator.createHref({
|
319 | pathname: joinedPathname,
|
320 | search,
|
321 | hash
|
322 | });
|
323 | }
|
324 | |
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 | function useInRouterContext() {
|
331 | return React__namespace.useContext(LocationContext) != null;
|
332 | }
|
333 | |
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 | function useLocation() {
|
345 | !useInRouterContext() ? router.invariant(false,
|
346 |
|
347 | "useLocation() may be used only in the context of a <Router> component.") : void 0;
|
348 | return React__namespace.useContext(LocationContext).location;
|
349 | }
|
350 | |
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | function useNavigationType() {
|
358 | return React__namespace.useContext(LocationContext).navigationType;
|
359 | }
|
360 | |
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 | function useMatch(pattern) {
|
369 | !useInRouterContext() ? router.invariant(false,
|
370 |
|
371 | "useMatch() may be used only in the context of a <Router> component.") : void 0;
|
372 | let {
|
373 | pathname
|
374 | } = useLocation();
|
375 | return React__namespace.useMemo(() => router.matchPath(pattern, pathname), [pathname, pattern]);
|
376 | }
|
377 | |
378 |
|
379 |
|
380 |
|
381 | |
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 | function useNavigate() {
|
388 | !useInRouterContext() ? router.invariant(false,
|
389 |
|
390 | "useNavigate() may be used only in the context of a <Router> component.") : void 0;
|
391 | let {
|
392 | basename,
|
393 | navigator
|
394 | } = React__namespace.useContext(NavigationContext);
|
395 | let {
|
396 | matches
|
397 | } = React__namespace.useContext(RouteContext);
|
398 | let {
|
399 | pathname: locationPathname
|
400 | } = useLocation();
|
401 | let routePathnamesJson = JSON.stringify(router.UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));
|
402 | let activeRef = React__namespace.useRef(false);
|
403 | React__namespace.useEffect(() => {
|
404 | activeRef.current = true;
|
405 | });
|
406 | let navigate = React__namespace.useCallback(function (to, options) {
|
407 | if (options === void 0) {
|
408 | options = {};
|
409 | }
|
410 |
|
411 | router.warning(activeRef.current, "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.") ;
|
412 | if (!activeRef.current) return;
|
413 |
|
414 | if (typeof to === "number") {
|
415 | navigator.go(to);
|
416 | return;
|
417 | }
|
418 |
|
419 | let path = router.resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
|
420 |
|
421 |
|
422 |
|
423 |
|
424 | if (basename !== "/") {
|
425 | path.pathname = path.pathname === "/" ? basename : router.joinPaths([basename, path.pathname]);
|
426 | }
|
427 |
|
428 | (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
|
429 | }, [basename, navigator, routePathnamesJson, locationPathname]);
|
430 | return navigate;
|
431 | }
|
432 | const OutletContext = React__namespace.createContext(null);
|
433 | |
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 | function useOutletContext() {
|
440 | return React__namespace.useContext(OutletContext);
|
441 | }
|
442 | |
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 | function useOutlet(context) {
|
450 | let outlet = React__namespace.useContext(RouteContext).outlet;
|
451 |
|
452 | if (outlet) {
|
453 | return React__namespace.createElement(OutletContext.Provider, {
|
454 | value: context
|
455 | }, outlet);
|
456 | }
|
457 |
|
458 | return outlet;
|
459 | }
|
460 | |
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | function useParams() {
|
468 | let {
|
469 | matches
|
470 | } = React__namespace.useContext(RouteContext);
|
471 | let routeMatch = matches[matches.length - 1];
|
472 | return routeMatch ? routeMatch.params : {};
|
473 | }
|
474 | |
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 | function useResolvedPath(to, _temp2) {
|
481 | let {
|
482 | relative
|
483 | } = _temp2 === void 0 ? {} : _temp2;
|
484 | let {
|
485 | matches
|
486 | } = React__namespace.useContext(RouteContext);
|
487 | let {
|
488 | pathname: locationPathname
|
489 | } = useLocation();
|
490 | let routePathnamesJson = JSON.stringify(router.UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase));
|
491 | return React__namespace.useMemo(() => router.resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
492 | }
|
493 | |
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 | function useRoutes(routes, locationArg) {
|
503 | !useInRouterContext() ? router.invariant(false,
|
504 |
|
505 | "useRoutes() may be used only in the context of a <Router> component.") : void 0;
|
506 | let dataRouterStateContext = React__namespace.useContext(DataRouterStateContext);
|
507 | let {
|
508 | matches: parentMatches
|
509 | } = React__namespace.useContext(RouteContext);
|
510 | let routeMatch = parentMatches[parentMatches.length - 1];
|
511 | let parentParams = routeMatch ? routeMatch.params : {};
|
512 | let parentPathname = routeMatch ? routeMatch.pathname : "/";
|
513 | let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
|
514 | let parentRoute = routeMatch && routeMatch.route;
|
515 |
|
516 | {
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 | let parentPath = parentRoute && parentRoute.path || "";
|
538 | warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
|
539 | }
|
540 |
|
541 | let locationFromContext = useLocation();
|
542 | let location;
|
543 |
|
544 | if (locationArg) {
|
545 | var _parsedLocationArg$pa;
|
546 |
|
547 | let parsedLocationArg = typeof locationArg === "string" ? router.parsePath(locationArg) : locationArg;
|
548 | !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? router.invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : void 0;
|
549 | location = parsedLocationArg;
|
550 | } else {
|
551 | location = locationFromContext;
|
552 | }
|
553 |
|
554 | let pathname = location.pathname || "/";
|
555 | let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
|
556 | let matches = router.matchRoutes(routes, {
|
557 | pathname: remainingPathname
|
558 | });
|
559 |
|
560 | {
|
561 | router.warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") ;
|
562 | router.warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") ;
|
563 | }
|
564 |
|
565 | let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {
|
566 | params: Object.assign({}, parentParams, match.params),
|
567 | pathname: router.joinPaths([parentPathnameBase, match.pathname]),
|
568 | pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : router.joinPaths([parentPathnameBase, match.pathnameBase])
|
569 | })), parentMatches, dataRouterStateContext || undefined);
|
570 |
|
571 |
|
572 |
|
573 |
|
574 | if (locationArg && renderedMatches) {
|
575 | return React__namespace.createElement(LocationContext.Provider, {
|
576 | value: {
|
577 | location: _extends({
|
578 | pathname: "/",
|
579 | search: "",
|
580 | hash: "",
|
581 | state: null,
|
582 | key: "default"
|
583 | }, location),
|
584 | navigationType: router.Action.Pop
|
585 | }
|
586 | }, renderedMatches);
|
587 | }
|
588 |
|
589 | return renderedMatches;
|
590 | }
|
591 |
|
592 | function DefaultErrorElement() {
|
593 | let error = useRouteError();
|
594 | let message = router.isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
|
595 | let stack = error instanceof Error ? error.stack : null;
|
596 | let lightgrey = "rgba(200,200,200, 0.5)";
|
597 | let preStyles = {
|
598 | padding: "0.5rem",
|
599 | backgroundColor: lightgrey
|
600 | };
|
601 | let codeStyles = {
|
602 | padding: "2px 4px",
|
603 | backgroundColor: lightgrey
|
604 | };
|
605 | return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("h2", null, "Unhandled Thrown Error!"), React__namespace.createElement("h3", {
|
606 | style: {
|
607 | fontStyle: "italic"
|
608 | }
|
609 | }, message), stack ? React__namespace.createElement("pre", {
|
610 | style: preStyles
|
611 | }, stack) : null, React__namespace.createElement("p", null, "\uD83D\uDCBF Hey developer \uD83D\uDC4B"), React__namespace.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own\xA0", React__namespace.createElement("code", {
|
612 | style: codeStyles
|
613 | }, "errorElement"), " props on\xA0", React__namespace.createElement("code", {
|
614 | style: codeStyles
|
615 | }, "<Route>")));
|
616 | }
|
617 |
|
618 | class RenderErrorBoundary extends React__namespace.Component {
|
619 | constructor(props) {
|
620 | super(props);
|
621 | this.state = {
|
622 | location: props.location,
|
623 | error: props.error
|
624 | };
|
625 | }
|
626 |
|
627 | static getDerivedStateFromError(error) {
|
628 | return {
|
629 | error: error
|
630 | };
|
631 | }
|
632 |
|
633 | static getDerivedStateFromProps(props, state) {
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 | if (state.location !== props.location) {
|
643 | return {
|
644 | error: props.error,
|
645 | location: props.location
|
646 | };
|
647 | }
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 | return {
|
654 | error: props.error || state.error,
|
655 | location: state.location
|
656 | };
|
657 | }
|
658 |
|
659 | componentDidCatch(error, errorInfo) {
|
660 | console.error("React Router caught the following error during render", error, errorInfo);
|
661 | }
|
662 |
|
663 | render() {
|
664 | return this.state.error ? React__namespace.createElement(RouteErrorContext.Provider, {
|
665 | value: this.state.error,
|
666 | children: this.props.component
|
667 | }) : this.props.children;
|
668 | }
|
669 |
|
670 | }
|
671 |
|
672 | function RenderedRoute(_ref) {
|
673 | let {
|
674 | routeContext,
|
675 | match,
|
676 | children
|
677 | } = _ref;
|
678 | let dataStaticRouterContext = React__namespace.useContext(DataStaticRouterContext);
|
679 |
|
680 |
|
681 | if (dataStaticRouterContext && match.route.errorElement) {
|
682 | dataStaticRouterContext._deepestRenderedBoundaryId = match.route.id;
|
683 | }
|
684 |
|
685 | return React__namespace.createElement(RouteContext.Provider, {
|
686 | value: routeContext
|
687 | }, children);
|
688 | }
|
689 |
|
690 | function _renderMatches(matches, parentMatches, dataRouterState) {
|
691 | if (parentMatches === void 0) {
|
692 | parentMatches = [];
|
693 | }
|
694 |
|
695 | if (matches == null) {
|
696 | if (dataRouterState != null && dataRouterState.errors) {
|
697 |
|
698 |
|
699 | matches = dataRouterState.matches;
|
700 | } else {
|
701 | return null;
|
702 | }
|
703 | }
|
704 |
|
705 | let renderedMatches = matches;
|
706 |
|
707 | let errors = dataRouterState == null ? void 0 : dataRouterState.errors;
|
708 |
|
709 | if (errors != null) {
|
710 | let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
|
711 | !(errorIndex >= 0) ? router.invariant(false, "Could not find a matching route for the current errors: " + errors) : void 0;
|
712 | renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
|
713 | }
|
714 |
|
715 | return renderedMatches.reduceRight((outlet, match, index) => {
|
716 | let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null;
|
717 |
|
718 | let errorElement = dataRouterState ? match.route.errorElement || React__namespace.createElement(DefaultErrorElement, null) : null;
|
719 |
|
720 | let getChildren = () => React__namespace.createElement(RenderedRoute, {
|
721 | match: match,
|
722 | routeContext: {
|
723 | outlet,
|
724 | matches: parentMatches.concat(renderedMatches.slice(0, index + 1))
|
725 | }
|
726 | }, error ? errorElement : match.route.element !== undefined ? match.route.element : outlet);
|
727 |
|
728 |
|
729 |
|
730 |
|
731 | return dataRouterState && (match.route.errorElement || index === 0) ? React__namespace.createElement(RenderErrorBoundary, {
|
732 | location: dataRouterState.location,
|
733 | component: errorElement,
|
734 | error: error,
|
735 | children: getChildren()
|
736 | }) : getChildren();
|
737 | }, null);
|
738 | }
|
739 | var DataRouterHook;
|
740 |
|
741 | (function (DataRouterHook) {
|
742 | DataRouterHook["UseRevalidator"] = "useRevalidator";
|
743 | })(DataRouterHook || (DataRouterHook = {}));
|
744 |
|
745 | var DataRouterStateHook;
|
746 |
|
747 | (function (DataRouterStateHook) {
|
748 | DataRouterStateHook["UseLoaderData"] = "useLoaderData";
|
749 | DataRouterStateHook["UseActionData"] = "useActionData";
|
750 | DataRouterStateHook["UseRouteError"] = "useRouteError";
|
751 | DataRouterStateHook["UseNavigation"] = "useNavigation";
|
752 | DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
|
753 | DataRouterStateHook["UseMatches"] = "useMatches";
|
754 | DataRouterStateHook["UseRevalidator"] = "useRevalidator";
|
755 | })(DataRouterStateHook || (DataRouterStateHook = {}));
|
756 |
|
757 | function getDataRouterConsoleError(hookName) {
|
758 | return hookName + " must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.";
|
759 | }
|
760 |
|
761 | function useDataRouterContext(hookName) {
|
762 | let ctx = React__namespace.useContext(DataRouterContext);
|
763 | !ctx ? router.invariant(false, getDataRouterConsoleError(hookName)) : void 0;
|
764 | return ctx;
|
765 | }
|
766 |
|
767 | function useDataRouterState(hookName) {
|
768 | let state = React__namespace.useContext(DataRouterStateContext);
|
769 | !state ? router.invariant(false, getDataRouterConsoleError(hookName)) : void 0;
|
770 | return state;
|
771 | }
|
772 | |
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 | function useNavigation() {
|
779 | let state = useDataRouterState(DataRouterStateHook.UseNavigation);
|
780 | return state.navigation;
|
781 | }
|
782 | |
783 |
|
784 |
|
785 |
|
786 |
|
787 | function useRevalidator() {
|
788 | let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);
|
789 | let state = useDataRouterState(DataRouterStateHook.UseRevalidator);
|
790 | return {
|
791 | revalidate: dataRouterContext.router.revalidate,
|
792 | state: state.revalidation
|
793 | };
|
794 | }
|
795 | |
796 |
|
797 |
|
798 |
|
799 |
|
800 | function useMatches() {
|
801 | let {
|
802 | matches,
|
803 | loaderData
|
804 | } = useDataRouterState(DataRouterStateHook.UseMatches);
|
805 | return React__namespace.useMemo(() => matches.map(match => {
|
806 | let {
|
807 | pathname,
|
808 | params
|
809 | } = match;
|
810 |
|
811 |
|
812 |
|
813 | return {
|
814 | id: match.route.id,
|
815 | pathname,
|
816 | params,
|
817 | data: loaderData[match.route.id],
|
818 | handle: match.route.handle
|
819 | };
|
820 | }), [matches, loaderData]);
|
821 | }
|
822 | |
823 |
|
824 |
|
825 |
|
826 | function useLoaderData() {
|
827 | let state = useDataRouterState(DataRouterStateHook.UseLoaderData);
|
828 | let route = React__namespace.useContext(RouteContext);
|
829 | !route ? router.invariant(false, "useLoaderData must be used inside a RouteContext") : void 0;
|
830 | let thisRoute = route.matches[route.matches.length - 1];
|
831 | !thisRoute.route.id ? router.invariant(false, "useLoaderData can only be used on routes that contain a unique \"id\"") : void 0;
|
832 | return state.loaderData[thisRoute.route.id];
|
833 | }
|
834 | |
835 |
|
836 |
|
837 |
|
838 | function useRouteLoaderData(routeId) {
|
839 | let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);
|
840 | return state.loaderData[routeId];
|
841 | }
|
842 | |
843 |
|
844 |
|
845 |
|
846 | function useActionData() {
|
847 | let state = useDataRouterState(DataRouterStateHook.UseActionData);
|
848 | let route = React__namespace.useContext(RouteContext);
|
849 | !route ? router.invariant(false, "useActionData must be used inside a RouteContext") : void 0;
|
850 | return Object.values((state == null ? void 0 : state.actionData) || {})[0];
|
851 | }
|
852 | |
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 | function useRouteError() {
|
859 | var _state$errors;
|
860 |
|
861 | let error = React__namespace.useContext(RouteErrorContext);
|
862 | let state = useDataRouterState(DataRouterStateHook.UseRouteError);
|
863 | let route = React__namespace.useContext(RouteContext);
|
864 | let thisRoute = route.matches[route.matches.length - 1];
|
865 |
|
866 |
|
867 | if (error) {
|
868 | return error;
|
869 | }
|
870 |
|
871 | !route ? router.invariant(false, "useRouteError must be used inside a RouteContext") : void 0;
|
872 | !thisRoute.route.id ? router.invariant(false, "useRouteError can only be used on routes that contain a unique \"id\"") : void 0;
|
873 |
|
874 | return (_state$errors = state.errors) == null ? void 0 : _state$errors[thisRoute.route.id];
|
875 | }
|
876 | |
877 |
|
878 |
|
879 |
|
880 | function useAsyncValue() {
|
881 | let value = React__namespace.useContext(AwaitContext);
|
882 | return value == null ? void 0 : value._data;
|
883 | }
|
884 | |
885 |
|
886 |
|
887 |
|
888 | function useAsyncError() {
|
889 | let value = React__namespace.useContext(AwaitContext);
|
890 | return value == null ? void 0 : value._error;
|
891 | }
|
892 | const alreadyWarned = {};
|
893 |
|
894 | function warningOnce(key, cond, message) {
|
895 | if (!cond && !alreadyWarned[key]) {
|
896 | alreadyWarned[key] = true;
|
897 | router.warning(false, message) ;
|
898 | }
|
899 | }
|
900 |
|
901 | |
902 |
|
903 |
|
904 | function RouterProvider(_ref) {
|
905 | let {
|
906 | fallbackElement,
|
907 | router
|
908 | } = _ref;
|
909 |
|
910 | let state = useSyncExternalStore(router.subscribe, () => router.state,
|
911 |
|
912 |
|
913 | () => router.state);
|
914 | let navigator = React__namespace.useMemo(() => {
|
915 | return {
|
916 | createHref: router.createHref,
|
917 | go: n => router.navigate(n),
|
918 | push: (to, state, opts) => router.navigate(to, {
|
919 | state,
|
920 | preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
|
921 | }),
|
922 | replace: (to, state, opts) => router.navigate(to, {
|
923 | replace: true,
|
924 | state,
|
925 | preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
|
926 | })
|
927 | };
|
928 | }, [router]);
|
929 | let basename = router.basename || "/";
|
930 | return React__namespace.createElement(DataRouterContext.Provider, {
|
931 | value: {
|
932 | router,
|
933 | navigator,
|
934 | static: false,
|
935 |
|
936 | basename
|
937 | }
|
938 | }, React__namespace.createElement(DataRouterStateContext.Provider, {
|
939 | value: state
|
940 | }, React__namespace.createElement(Router, {
|
941 | basename: router.basename,
|
942 | location: router.state.location,
|
943 | navigationType: router.state.historyAction,
|
944 | navigator: navigator
|
945 | }, router.state.initialized ? React__namespace.createElement(Routes, null) : fallbackElement)));
|
946 | }
|
947 |
|
948 | |
949 |
|
950 |
|
951 |
|
952 |
|
953 | function MemoryRouter(_ref2) {
|
954 | let {
|
955 | basename,
|
956 | children,
|
957 | initialEntries,
|
958 | initialIndex
|
959 | } = _ref2;
|
960 | let historyRef = React__namespace.useRef();
|
961 |
|
962 | if (historyRef.current == null) {
|
963 | historyRef.current = router.createMemoryHistory({
|
964 | initialEntries,
|
965 | initialIndex,
|
966 | v5Compat: true
|
967 | });
|
968 | }
|
969 |
|
970 | let history = historyRef.current;
|
971 | let [state, setState] = React__namespace.useState({
|
972 | action: history.action,
|
973 | location: history.location
|
974 | });
|
975 | React__namespace.useLayoutEffect(() => history.listen(setState), [history]);
|
976 | return React__namespace.createElement(Router, {
|
977 | basename: basename,
|
978 | children: children,
|
979 | location: state.location,
|
980 | navigationType: state.action,
|
981 | navigator: history
|
982 | });
|
983 | }
|
984 |
|
985 | |
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 | function Navigate(_ref3) {
|
995 | let {
|
996 | to,
|
997 | replace,
|
998 | state,
|
999 | relative
|
1000 | } = _ref3;
|
1001 | !useInRouterContext() ? router.invariant(false,
|
1002 |
|
1003 | "<Navigate> may be used only in the context of a <Router> component.") : void 0;
|
1004 | router.warning(!React__namespace.useContext(NavigationContext).static, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") ;
|
1005 | let dataRouterState = React__namespace.useContext(DataRouterStateContext);
|
1006 | let navigate = useNavigate();
|
1007 | React__namespace.useEffect(() => {
|
1008 |
|
1009 |
|
1010 |
|
1011 | if (dataRouterState && dataRouterState.navigation.state !== "idle") {
|
1012 | return;
|
1013 | }
|
1014 |
|
1015 | navigate(to, {
|
1016 | replace,
|
1017 | state,
|
1018 | relative
|
1019 | });
|
1020 | });
|
1021 | return null;
|
1022 | }
|
1023 |
|
1024 | |
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 | function Outlet(props) {
|
1030 | return useOutlet(props.context);
|
1031 | }
|
1032 |
|
1033 | |
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 | function Route(_props) {
|
1039 | router.invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") ;
|
1040 | }
|
1041 |
|
1042 | |
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 | function Router(_ref4) {
|
1052 | let {
|
1053 | basename: basenameProp = "/",
|
1054 | children = null,
|
1055 | location: locationProp,
|
1056 | navigationType = router.Action.Pop,
|
1057 | navigator,
|
1058 | static: staticProp = false
|
1059 | } = _ref4;
|
1060 | !!useInRouterContext() ? router.invariant(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : void 0;
|
1061 |
|
1062 |
|
1063 | let basename = basenameProp.replace(/^\/*/, "/");
|
1064 | let navigationContext = React__namespace.useMemo(() => ({
|
1065 | basename,
|
1066 | navigator,
|
1067 | static: staticProp
|
1068 | }), [basename, navigator, staticProp]);
|
1069 |
|
1070 | if (typeof locationProp === "string") {
|
1071 | locationProp = router.parsePath(locationProp);
|
1072 | }
|
1073 |
|
1074 | let {
|
1075 | pathname = "/",
|
1076 | search = "",
|
1077 | hash = "",
|
1078 | state = null,
|
1079 | key = "default"
|
1080 | } = locationProp;
|
1081 | let location = React__namespace.useMemo(() => {
|
1082 | let trailingPathname = router.stripBasename(pathname, basename);
|
1083 |
|
1084 | if (trailingPathname == null) {
|
1085 | return null;
|
1086 | }
|
1087 |
|
1088 | return {
|
1089 | pathname: trailingPathname,
|
1090 | search,
|
1091 | hash,
|
1092 | state,
|
1093 | key
|
1094 | };
|
1095 | }, [basename, pathname, search, hash, state, key]);
|
1096 | router.warning(location != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") ;
|
1097 |
|
1098 | if (location == null) {
|
1099 | return null;
|
1100 | }
|
1101 |
|
1102 | return React__namespace.createElement(NavigationContext.Provider, {
|
1103 | value: navigationContext
|
1104 | }, React__namespace.createElement(LocationContext.Provider, {
|
1105 | children: children,
|
1106 | value: {
|
1107 | location,
|
1108 | navigationType
|
1109 | }
|
1110 | }));
|
1111 | }
|
1112 |
|
1113 | |
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 | function Routes(_ref5) {
|
1120 | let {
|
1121 | children,
|
1122 | location
|
1123 | } = _ref5;
|
1124 | let dataRouterContext = React__namespace.useContext(DataRouterContext);
|
1125 |
|
1126 |
|
1127 |
|
1128 | let routes = dataRouterContext && !children ? dataRouterContext.router.routes : createRoutesFromChildren(children);
|
1129 | return useRoutes(routes, location);
|
1130 | }
|
1131 |
|
1132 | |
1133 |
|
1134 |
|
1135 |
|
1136 | function Await(_ref6) {
|
1137 | let {
|
1138 | children,
|
1139 | errorElement,
|
1140 | resolve
|
1141 | } = _ref6;
|
1142 | return React__namespace.createElement(AwaitErrorBoundary, {
|
1143 | resolve: resolve,
|
1144 | errorElement: errorElement
|
1145 | }, React__namespace.createElement(ResolveAwait, null, children));
|
1146 | }
|
1147 | var AwaitRenderStatus;
|
1148 |
|
1149 | (function (AwaitRenderStatus) {
|
1150 | AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending";
|
1151 | AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success";
|
1152 | AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error";
|
1153 | })(AwaitRenderStatus || (AwaitRenderStatus = {}));
|
1154 |
|
1155 | const neverSettledPromise = new Promise(() => {});
|
1156 |
|
1157 | class AwaitErrorBoundary extends React__namespace.Component {
|
1158 | constructor(props) {
|
1159 | super(props);
|
1160 | this.state = {
|
1161 | error: null
|
1162 | };
|
1163 | }
|
1164 |
|
1165 | static getDerivedStateFromError(error) {
|
1166 | return {
|
1167 | error
|
1168 | };
|
1169 | }
|
1170 |
|
1171 | componentDidCatch(error, errorInfo) {
|
1172 | console.error("<Await> caught the following error during render", error, errorInfo);
|
1173 | }
|
1174 |
|
1175 | render() {
|
1176 | let {
|
1177 | children,
|
1178 | errorElement,
|
1179 | resolve
|
1180 | } = this.props;
|
1181 | let promise = null;
|
1182 | let status = AwaitRenderStatus.pending;
|
1183 |
|
1184 | if (!(resolve instanceof Promise)) {
|
1185 |
|
1186 | status = AwaitRenderStatus.success;
|
1187 | promise = Promise.resolve();
|
1188 | Object.defineProperty(promise, "_tracked", {
|
1189 | get: () => true
|
1190 | });
|
1191 | Object.defineProperty(promise, "_data", {
|
1192 | get: () => resolve
|
1193 | });
|
1194 | } else if (this.state.error) {
|
1195 |
|
1196 | status = AwaitRenderStatus.error;
|
1197 | let renderError = this.state.error;
|
1198 | promise = Promise.reject().catch(() => {});
|
1199 |
|
1200 | Object.defineProperty(promise, "_tracked", {
|
1201 | get: () => true
|
1202 | });
|
1203 | Object.defineProperty(promise, "_error", {
|
1204 | get: () => renderError
|
1205 | });
|
1206 | } else if (resolve._tracked) {
|
1207 |
|
1208 | promise = resolve;
|
1209 | status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
|
1210 | } else {
|
1211 |
|
1212 | status = AwaitRenderStatus.pending;
|
1213 | Object.defineProperty(resolve, "_tracked", {
|
1214 | get: () => true
|
1215 | });
|
1216 | promise = resolve.then(data => Object.defineProperty(resolve, "_data", {
|
1217 | get: () => data
|
1218 | }), error => Object.defineProperty(resolve, "_error", {
|
1219 | get: () => error
|
1220 | }));
|
1221 | }
|
1222 |
|
1223 | if (status === AwaitRenderStatus.error && promise._error instanceof router.AbortedDeferredError) {
|
1224 |
|
1225 | throw neverSettledPromise;
|
1226 | }
|
1227 |
|
1228 | if (status === AwaitRenderStatus.error && !errorElement) {
|
1229 |
|
1230 | throw promise._error;
|
1231 | }
|
1232 |
|
1233 | if (status === AwaitRenderStatus.error) {
|
1234 |
|
1235 | return React__namespace.createElement(AwaitContext.Provider, {
|
1236 | value: promise,
|
1237 | children: errorElement
|
1238 | });
|
1239 | }
|
1240 |
|
1241 | if (status === AwaitRenderStatus.success) {
|
1242 |
|
1243 | return React__namespace.createElement(AwaitContext.Provider, {
|
1244 | value: promise,
|
1245 | children: children
|
1246 | });
|
1247 | }
|
1248 |
|
1249 |
|
1250 | throw promise;
|
1251 | }
|
1252 |
|
1253 | }
|
1254 | |
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 | function ResolveAwait(_ref7) {
|
1261 | let {
|
1262 | children
|
1263 | } = _ref7;
|
1264 | let data = useAsyncValue();
|
1265 |
|
1266 | if (typeof children === "function") {
|
1267 | return children(data);
|
1268 | }
|
1269 |
|
1270 | return React__namespace.createElement(React__namespace.Fragment, null, children);
|
1271 | }
|
1272 |
|
1273 |
|
1274 |
|
1275 | |
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 | function createRoutesFromChildren(children, parentPath) {
|
1285 | if (parentPath === void 0) {
|
1286 | parentPath = [];
|
1287 | }
|
1288 |
|
1289 | let routes = [];
|
1290 | React__namespace.Children.forEach(children, (element, index) => {
|
1291 | if (! React__namespace.isValidElement(element)) {
|
1292 |
|
1293 |
|
1294 | return;
|
1295 | }
|
1296 |
|
1297 | if (element.type === React__namespace.Fragment) {
|
1298 |
|
1299 | routes.push.apply(routes, createRoutesFromChildren(element.props.children, parentPath));
|
1300 | return;
|
1301 | }
|
1302 |
|
1303 | !(element.type === Route) ? router.invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : void 0;
|
1304 | !(!element.props.index || !element.props.children) ? router.invariant(false, "An index route cannot have child routes.") : void 0;
|
1305 | let treePath = [...parentPath, index];
|
1306 | let route = {
|
1307 | id: element.props.id || treePath.join("-"),
|
1308 | caseSensitive: element.props.caseSensitive,
|
1309 | element: element.props.element,
|
1310 | index: element.props.index,
|
1311 | path: element.props.path,
|
1312 | loader: element.props.loader,
|
1313 | action: element.props.action,
|
1314 | errorElement: element.props.errorElement,
|
1315 | hasErrorBoundary: element.props.errorElement != null,
|
1316 | shouldRevalidate: element.props.shouldRevalidate,
|
1317 | handle: element.props.handle
|
1318 | };
|
1319 |
|
1320 | if (element.props.children) {
|
1321 | route.children = createRoutesFromChildren(element.props.children, treePath);
|
1322 | }
|
1323 |
|
1324 | routes.push(route);
|
1325 | });
|
1326 | return routes;
|
1327 | }
|
1328 | |
1329 |
|
1330 |
|
1331 |
|
1332 | function renderMatches(matches) {
|
1333 | return _renderMatches(matches);
|
1334 | }
|
1335 | |
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 | function enhanceManualRouteObjects(routes) {
|
1342 | return routes.map(route => {
|
1343 | let routeClone = _extends({}, route);
|
1344 |
|
1345 | if (routeClone.hasErrorBoundary == null) {
|
1346 | routeClone.hasErrorBoundary = routeClone.errorElement != null;
|
1347 | }
|
1348 |
|
1349 | if (routeClone.children) {
|
1350 | routeClone.children = enhanceManualRouteObjects(routeClone.children);
|
1351 | }
|
1352 |
|
1353 | return routeClone;
|
1354 | });
|
1355 | }
|
1356 |
|
1357 | function createMemoryRouter(routes, opts) {
|
1358 | return router.createRouter({
|
1359 | basename: opts == null ? void 0 : opts.basename,
|
1360 | history: router.createMemoryHistory({
|
1361 | initialEntries: opts == null ? void 0 : opts.initialEntries,
|
1362 | initialIndex: opts == null ? void 0 : opts.initialIndex
|
1363 | }),
|
1364 | hydrationData: opts == null ? void 0 : opts.hydrationData,
|
1365 | routes: enhanceManualRouteObjects(routes)
|
1366 | }).initialize();
|
1367 | }
|
1368 |
|
1369 | Object.defineProperty(exports, 'AbortedDeferredError', {
|
1370 | enumerable: true,
|
1371 | get: function () { return router.AbortedDeferredError; }
|
1372 | });
|
1373 | Object.defineProperty(exports, 'NavigationType', {
|
1374 | enumerable: true,
|
1375 | get: function () { return router.Action; }
|
1376 | });
|
1377 | Object.defineProperty(exports, 'createPath', {
|
1378 | enumerable: true,
|
1379 | get: function () { return router.createPath; }
|
1380 | });
|
1381 | Object.defineProperty(exports, 'defer', {
|
1382 | enumerable: true,
|
1383 | get: function () { return router.defer; }
|
1384 | });
|
1385 | Object.defineProperty(exports, 'generatePath', {
|
1386 | enumerable: true,
|
1387 | get: function () { return router.generatePath; }
|
1388 | });
|
1389 | Object.defineProperty(exports, 'isRouteErrorResponse', {
|
1390 | enumerable: true,
|
1391 | get: function () { return router.isRouteErrorResponse; }
|
1392 | });
|
1393 | Object.defineProperty(exports, 'json', {
|
1394 | enumerable: true,
|
1395 | get: function () { return router.json; }
|
1396 | });
|
1397 | Object.defineProperty(exports, 'matchPath', {
|
1398 | enumerable: true,
|
1399 | get: function () { return router.matchPath; }
|
1400 | });
|
1401 | Object.defineProperty(exports, 'matchRoutes', {
|
1402 | enumerable: true,
|
1403 | get: function () { return router.matchRoutes; }
|
1404 | });
|
1405 | Object.defineProperty(exports, 'parsePath', {
|
1406 | enumerable: true,
|
1407 | get: function () { return router.parsePath; }
|
1408 | });
|
1409 | Object.defineProperty(exports, 'redirect', {
|
1410 | enumerable: true,
|
1411 | get: function () { return router.redirect; }
|
1412 | });
|
1413 | Object.defineProperty(exports, 'resolvePath', {
|
1414 | enumerable: true,
|
1415 | get: function () { return router.resolvePath; }
|
1416 | });
|
1417 | exports.Await = Await;
|
1418 | exports.MemoryRouter = MemoryRouter;
|
1419 | exports.Navigate = Navigate;
|
1420 | exports.Outlet = Outlet;
|
1421 | exports.Route = Route;
|
1422 | exports.Router = Router;
|
1423 | exports.RouterProvider = RouterProvider;
|
1424 | exports.Routes = Routes;
|
1425 | exports.UNSAFE_DataRouterContext = DataRouterContext;
|
1426 | exports.UNSAFE_DataRouterStateContext = DataRouterStateContext;
|
1427 | exports.UNSAFE_DataStaticRouterContext = DataStaticRouterContext;
|
1428 | exports.UNSAFE_LocationContext = LocationContext;
|
1429 | exports.UNSAFE_NavigationContext = NavigationContext;
|
1430 | exports.UNSAFE_RouteContext = RouteContext;
|
1431 | exports.UNSAFE_enhanceManualRouteObjects = enhanceManualRouteObjects;
|
1432 | exports.createMemoryRouter = createMemoryRouter;
|
1433 | exports.createRoutesFromChildren = createRoutesFromChildren;
|
1434 | exports.createRoutesFromElements = createRoutesFromChildren;
|
1435 | exports.renderMatches = renderMatches;
|
1436 | exports.useActionData = useActionData;
|
1437 | exports.useAsyncError = useAsyncError;
|
1438 | exports.useAsyncValue = useAsyncValue;
|
1439 | exports.useHref = useHref;
|
1440 | exports.useInRouterContext = useInRouterContext;
|
1441 | exports.useLoaderData = useLoaderData;
|
1442 | exports.useLocation = useLocation;
|
1443 | exports.useMatch = useMatch;
|
1444 | exports.useMatches = useMatches;
|
1445 | exports.useNavigate = useNavigate;
|
1446 | exports.useNavigation = useNavigation;
|
1447 | exports.useNavigationType = useNavigationType;
|
1448 | exports.useOutlet = useOutlet;
|
1449 | exports.useOutletContext = useOutletContext;
|
1450 | exports.useParams = useParams;
|
1451 | exports.useResolvedPath = useResolvedPath;
|
1452 | exports.useRevalidator = useRevalidator;
|
1453 | exports.useRouteError = useRouteError;
|
1454 | exports.useRouteLoaderData = useRouteLoaderData;
|
1455 | exports.useRoutes = useRoutes;
|
1456 |
|
1457 | Object.defineProperty(exports, '__esModule', { value: true });
|
1458 |
|
1459 | }));
|
1460 |
|