@tanstack/react-router 0.0.1-beta.20 → 0.0.1-beta.201

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.
@@ -0,0 +1,657 @@
1
+ /**
2
+ * @tanstack/react-router/src/index.tsx
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ 'use strict';
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
16
+ var React = require('react');
17
+ var reactStore = require('@tanstack/react-store');
18
+ var invariant = require('tiny-invariant');
19
+ var warning = require('tiny-warning');
20
+ var routerCore = require('@tanstack/router-core');
21
+
22
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
+
24
+ function _interopNamespace(e) {
25
+ if (e && e.__esModule) return e;
26
+ var n = Object.create(null);
27
+ if (e) {
28
+ Object.keys(e).forEach(function (k) {
29
+ if (k !== 'default') {
30
+ var d = Object.getOwnPropertyDescriptor(e, k);
31
+ Object.defineProperty(n, k, d.get ? d : {
32
+ enumerable: true,
33
+ get: function () { return e[k]; }
34
+ });
35
+ }
36
+ });
37
+ }
38
+ n["default"] = e;
39
+ return Object.freeze(n);
40
+ }
41
+
42
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
43
+ var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
44
+ var warning__default = /*#__PURE__*/_interopDefaultLegacy(warning);
45
+
46
+ const useLayoutEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect;
47
+ routerCore.Route.__onInit = route => {
48
+ Object.assign(route, {
49
+ useMatch: (opts = {}) => {
50
+ return useMatch({
51
+ ...opts,
52
+ from: route.id
53
+ });
54
+ },
55
+ useLoader: (opts = {}) => {
56
+ return useLoader({
57
+ ...opts,
58
+ from: route.id
59
+ });
60
+ },
61
+ useRouteContext: (opts = {}) => {
62
+ return useMatch({
63
+ ...opts,
64
+ from: route.id,
65
+ select: d => opts?.select ? opts.select(d.context) : d.context
66
+ });
67
+ },
68
+ useSearch: (opts = {}) => {
69
+ return useSearch({
70
+ ...opts,
71
+ from: route.id
72
+ });
73
+ },
74
+ useParams: (opts = {}) => {
75
+ return useParams({
76
+ ...opts,
77
+ from: route.id
78
+ });
79
+ }
80
+ });
81
+ };
82
+
83
+ //
84
+
85
+ function lazyRouteComponent(importer, exportName) {
86
+ let loadPromise;
87
+ const load = () => {
88
+ if (!loadPromise) {
89
+ loadPromise = importer();
90
+ }
91
+ return loadPromise;
92
+ };
93
+ const lazyComp = /*#__PURE__*/React__namespace.lazy(async () => {
94
+ const moduleExports = await load();
95
+ const comp = moduleExports[exportName ?? 'default'];
96
+ return {
97
+ default: comp
98
+ };
99
+ });
100
+ lazyComp.preload = load;
101
+ return lazyComp;
102
+ }
103
+ //
104
+
105
+ function useLinkProps(options) {
106
+ const router = useRouter();
107
+ const match = useMatch({
108
+ strict: false
109
+ });
110
+ const {
111
+ // custom props
112
+ type,
113
+ children,
114
+ target,
115
+ activeProps = () => ({
116
+ className: 'active'
117
+ }),
118
+ inactiveProps = () => ({}),
119
+ activeOptions,
120
+ disabled,
121
+ hash,
122
+ search,
123
+ params,
124
+ to = '.',
125
+ state,
126
+ mask,
127
+ preload,
128
+ preloadDelay,
129
+ replace,
130
+ // element props
131
+ style,
132
+ className,
133
+ onClick,
134
+ onFocus,
135
+ onMouseEnter,
136
+ onMouseLeave,
137
+ onTouchStart,
138
+ ...rest
139
+ } = options;
140
+ const linkInfo = router.buildLink({
141
+ from: match.pathname,
142
+ ...options
143
+ });
144
+ if (linkInfo.type === 'external') {
145
+ const {
146
+ href
147
+ } = linkInfo;
148
+ return {
149
+ href
150
+ };
151
+ }
152
+ const {
153
+ handleClick,
154
+ handleFocus,
155
+ handleEnter,
156
+ handleLeave,
157
+ handleTouchStart,
158
+ isActive,
159
+ next
160
+ } = linkInfo;
161
+ const handleReactClick = e => {
162
+ if (options.startTransition ?? true) {
163
+ (React__namespace.startTransition || (d => d))(() => {
164
+ handleClick(e);
165
+ });
166
+ }
167
+ };
168
+ const composeHandlers = handlers => e => {
169
+ if (e.persist) e.persist();
170
+ handlers.filter(Boolean).forEach(handler => {
171
+ if (e.defaultPrevented) return;
172
+ handler(e);
173
+ });
174
+ };
175
+
176
+ // Get the active props
177
+ const resolvedActiveProps = isActive ? routerCore.functionalUpdate(activeProps, {}) ?? {} : {};
178
+
179
+ // Get the inactive props
180
+ const resolvedInactiveProps = isActive ? {} : routerCore.functionalUpdate(inactiveProps, {}) ?? {};
181
+ return {
182
+ ...resolvedActiveProps,
183
+ ...resolvedInactiveProps,
184
+ ...rest,
185
+ href: disabled ? undefined : next.maskedLocation ? next.maskedLocation.href : next.href,
186
+ onClick: composeHandlers([onClick, handleReactClick]),
187
+ onFocus: composeHandlers([onFocus, handleFocus]),
188
+ onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
189
+ onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
190
+ onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
191
+ target,
192
+ style: {
193
+ ...style,
194
+ ...resolvedActiveProps.style,
195
+ ...resolvedInactiveProps.style
196
+ },
197
+ className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined,
198
+ ...(disabled ? {
199
+ role: 'link',
200
+ 'aria-disabled': true
201
+ } : undefined),
202
+ ['data-status']: isActive ? 'active' : undefined
203
+ };
204
+ }
205
+ const Link = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
206
+ const linkProps = useLinkProps(props);
207
+ return /*#__PURE__*/React__namespace.createElement("a", _rollupPluginBabelHelpers["extends"]({
208
+ ref: ref
209
+ }, linkProps, {
210
+ children: typeof props.children === 'function' ? props.children({
211
+ isActive: linkProps['data-status'] === 'active'
212
+ }) : props.children
213
+ }));
214
+ });
215
+ function Navigate(props) {
216
+ const router = useRouter();
217
+ const match = useMatch({
218
+ strict: false
219
+ });
220
+ useLayoutEffect(() => {
221
+ router.navigate({
222
+ from: match.pathname,
223
+ ...props
224
+ });
225
+ }, []);
226
+ return null;
227
+ }
228
+ const matchIdsContext = /*#__PURE__*/React__namespace.createContext(null);
229
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
230
+ function useRouterState(opts) {
231
+ const router = useRouter();
232
+ return reactStore.useStore(router.__store, opts?.select);
233
+ }
234
+ function RouterProvider({
235
+ router,
236
+ ...rest
237
+ }) {
238
+ router.update(rest);
239
+ React__namespace.useEffect(() => {
240
+ let unsub;
241
+ React__namespace.startTransition(() => {
242
+ unsub = router.mount();
243
+ });
244
+ return unsub;
245
+ }, [router]);
246
+ const Wrap = router.options.Wrap || React__namespace.Fragment;
247
+ return /*#__PURE__*/React__namespace.createElement(Wrap, null, /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
248
+ value: router
249
+ }, /*#__PURE__*/React__namespace.createElement(Matches, null)));
250
+ }
251
+ function Matches() {
252
+ const router = useRouter();
253
+ const matchIds = useRouterState({
254
+ select: state => {
255
+ return state.renderedMatchIds;
256
+ }
257
+ });
258
+ const locationKey = useRouterState({
259
+ select: d => d.resolvedLocation.state?.key
260
+ });
261
+ const route = router.getRoute(routerCore.rootRouteId);
262
+ const errorComponent = React__namespace.useCallback(props => {
263
+ return /*#__PURE__*/React__namespace.createElement(ErrorComponent, {
264
+ ...props,
265
+ useMatch: route.useMatch,
266
+ useRouteContext: route.useRouteContext,
267
+ useSearch: route.useSearch,
268
+ useParams: route.useParams
269
+ });
270
+ }, [route]);
271
+ return /*#__PURE__*/React__namespace.createElement(matchIdsContext.Provider, {
272
+ value: [undefined, ...matchIds]
273
+ }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
274
+ resetKey: locationKey,
275
+ errorComponent: errorComponent,
276
+ onCatch: () => {
277
+ warning__default["default"](false, `Error in router! Consider setting an 'errorComponent' in your RootRoute! 👍`);
278
+ }
279
+ }, /*#__PURE__*/React__namespace.createElement(Outlet, null)));
280
+ }
281
+ function useRouter() {
282
+ const value = React__namespace.useContext(routerContext);
283
+ warning__default["default"](value, 'useRouter must be used inside a <Router> component!');
284
+ return value;
285
+ }
286
+ function useMatches(opts) {
287
+ const matchIds = React__namespace.useContext(matchIdsContext);
288
+ return useRouterState({
289
+ select: state => {
290
+ const matches = state.renderedMatches.slice(state.renderedMatches.findIndex(d => d.id === matchIds[0]));
291
+ return opts?.select ? opts.select(matches) : matches;
292
+ }
293
+ });
294
+ }
295
+ function useMatch(opts) {
296
+ const router = useRouter();
297
+ const nearestMatchId = React__namespace.useContext(matchIdsContext)[0];
298
+ const nearestMatchRouteId = router.getRouteMatch(nearestMatchId)?.routeId;
299
+ const matchRouteId = useRouterState({
300
+ select: state => {
301
+ const match = opts?.from ? state.renderedMatches.find(d => d.routeId === opts?.from) : state.renderedMatches.find(d => d.id === nearestMatchId);
302
+ return match.routeId;
303
+ }
304
+ });
305
+ if (opts?.strict ?? true) {
306
+ invariant__default["default"](nearestMatchRouteId == matchRouteId, `useMatch("${matchRouteId}") is being called in a component that is meant to render the '${nearestMatchRouteId}' route. Did you mean to 'useMatch("${matchRouteId}", { strict: false })' or 'useRoute("${matchRouteId}")' instead?`);
307
+ }
308
+ const matchSelection = useRouterState({
309
+ select: state => {
310
+ const match = opts?.from ? state.renderedMatches.find(d => d.routeId === opts?.from) : state.renderedMatches.find(d => d.id === nearestMatchId);
311
+ invariant__default["default"](match, `Could not find ${opts?.from ? `an active match from "${opts.from}"` : 'a nearest match!'}`);
312
+ return opts?.select ? opts.select(match) : match;
313
+ }
314
+ });
315
+ return matchSelection;
316
+ }
317
+ function useLoader(opts) {
318
+ return useMatch({
319
+ ...opts,
320
+ select: match => opts?.select ? opts?.select(match.loaderData) : match.loaderData
321
+ });
322
+ }
323
+ function useRouterContext(opts) {
324
+ return useMatch({
325
+ ...opts,
326
+ select: match => opts?.select ? opts.select(match.context) : match.context
327
+ });
328
+ }
329
+ function useRouteContext(opts) {
330
+ return useMatch({
331
+ ...opts,
332
+ select: match => opts?.select ? opts.select(match.context) : match.context
333
+ });
334
+ }
335
+ function useSearch(opts) {
336
+ return useMatch({
337
+ ...opts,
338
+ select: match => {
339
+ return opts?.select ? opts.select(match.search) : match.search;
340
+ }
341
+ });
342
+ }
343
+ function useParams(opts) {
344
+ return useRouterState({
345
+ select: state => {
346
+ const params = routerCore.last(state.renderedMatches)?.params;
347
+ return opts?.select ? opts.select(params) : params;
348
+ }
349
+ });
350
+ }
351
+ function useNavigate(defaultOpts) {
352
+ const router = useRouter();
353
+ const match = useMatch({
354
+ strict: false
355
+ });
356
+ return React__namespace.useCallback(opts => {
357
+ return router.navigate({
358
+ from: match.pathname,
359
+ ...defaultOpts,
360
+ ...opts
361
+ });
362
+ }, []);
363
+ }
364
+ function useMatchRoute() {
365
+ const router = useRouter();
366
+ return React__namespace.useCallback(opts => {
367
+ const {
368
+ pending,
369
+ caseSensitive,
370
+ ...rest
371
+ } = opts;
372
+ return router.matchRoute(rest, {
373
+ pending,
374
+ caseSensitive
375
+ });
376
+ }, []);
377
+ }
378
+ function MatchRoute(props) {
379
+ const matchRoute = useMatchRoute();
380
+ const params = matchRoute(props);
381
+ if (typeof props.children === 'function') {
382
+ return props.children(params);
383
+ }
384
+ return !!params ? props.children : null;
385
+ }
386
+ function Outlet() {
387
+ const matchIds = React__namespace.useContext(matchIdsContext).slice(1);
388
+ if (!matchIds[0]) {
389
+ return null;
390
+ }
391
+ return /*#__PURE__*/React__namespace.createElement(Match, {
392
+ matchIds: matchIds
393
+ });
394
+ }
395
+ const defaultPending = () => null;
396
+ function Match({
397
+ matchIds
398
+ }) {
399
+ const router = useRouter();
400
+ const matchId = matchIds[0];
401
+ const routeId = router.getRouteMatch(matchId).routeId;
402
+ const route = router.getRoute(routeId);
403
+ const locationKey = useRouterState({
404
+ select: s => s.resolvedLocation.state?.key
405
+ });
406
+ const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent ?? defaultPending;
407
+ const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent ?? ErrorComponent;
408
+ const ResolvedSuspenseBoundary = route.options.wrapInSuspense ?? !route.isRoot ? React__namespace.Suspense : SafeFragment;
409
+ const ResolvedCatchBoundary = !!routeErrorComponent ? CatchBoundary : SafeFragment;
410
+ const errorComponent = React__namespace.useCallback(props => {
411
+ return /*#__PURE__*/React__namespace.createElement(routeErrorComponent, {
412
+ ...props,
413
+ useMatch: route.useMatch,
414
+ useRouteContext: route.useRouteContext,
415
+ useSearch: route.useSearch,
416
+ useParams: route.useParams
417
+ });
418
+ }, [route]);
419
+ return /*#__PURE__*/React__namespace.createElement(matchIdsContext.Provider, {
420
+ value: matchIds
421
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedSuspenseBoundary, {
422
+ fallback: /*#__PURE__*/React__namespace.createElement(PendingComponent, {
423
+ useMatch: route.useMatch,
424
+ useRouteContext: route.useRouteContext,
425
+ useSearch: route.useSearch,
426
+ useParams: route.useParams
427
+ })
428
+ }, /*#__PURE__*/React__namespace.createElement(ResolvedCatchBoundary, {
429
+ resetKey: locationKey,
430
+ errorComponent: errorComponent,
431
+ onCatch: () => {
432
+ warning__default["default"](false, `Error in route match: ${matchId}`);
433
+ }
434
+ }, /*#__PURE__*/React__namespace.createElement(MatchInner, {
435
+ matchId: matchId,
436
+ PendingComponent: PendingComponent
437
+ }))));
438
+ }
439
+ function MatchInner({
440
+ matchId,
441
+ PendingComponent
442
+ }) {
443
+ const router = useRouter();
444
+ const match = useRouterState({
445
+ select: d => {
446
+ const match = d.matchesById[matchId];
447
+ return routerCore.pick(match, ['status', 'loadPromise', 'routeId', 'error']);
448
+ }
449
+ });
450
+ const route = router.getRoute(match.routeId);
451
+ if (match.status === 'error') {
452
+ throw match.error;
453
+ }
454
+ if (match.status === 'pending') {
455
+ return /*#__PURE__*/React__namespace.createElement(PendingComponent, {
456
+ useLoader: route.useLoader,
457
+ useMatch: route.useMatch,
458
+ useRouteContext: route.useRouteContext,
459
+ useSearch: route.useSearch,
460
+ useParams: route.useParams
461
+ });
462
+ }
463
+ if (match.status === 'success') {
464
+ let comp = route.options.component ?? router.options.defaultComponent;
465
+ if (comp) {
466
+ return /*#__PURE__*/React__namespace.createElement(comp, {
467
+ useLoader: route.useLoader,
468
+ useMatch: route.useMatch,
469
+ useRouteContext: route.useRouteContext,
470
+ useSearch: route.useSearch,
471
+ useParams: route.useParams
472
+ });
473
+ }
474
+ return /*#__PURE__*/React__namespace.createElement(Outlet, null);
475
+ }
476
+ invariant__default["default"](false, 'Idle routeMatch status encountered during rendering! You should never see this. File an issue!');
477
+ }
478
+ function SafeFragment(props) {
479
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, props.children);
480
+ }
481
+ function useInjectHtml() {
482
+ const router = useRouter();
483
+ return React__namespace.useCallback(html => {
484
+ router.injectHtml(html);
485
+ }, []);
486
+ }
487
+ function useDehydrate() {
488
+ const router = useRouter();
489
+ return React__namespace.useCallback(function dehydrate(key, data) {
490
+ return router.dehydrateData(key, data);
491
+ }, []);
492
+ }
493
+ function useHydrate() {
494
+ const router = useRouter();
495
+ return function hydrate(key) {
496
+ return router.hydrateData(key);
497
+ };
498
+ }
499
+
500
+ // This is the messiest thing ever... I'm either seriously tired (likely) or
501
+ // there has to be a better way to reset error boundaries when the
502
+ // router's location key changes.
503
+
504
+ function CatchBoundary(props) {
505
+ const errorComponent = props.errorComponent ?? ErrorComponent;
506
+ return /*#__PURE__*/React__namespace.createElement(CatchBoundaryImpl, {
507
+ resetKey: props.resetKey,
508
+ onCatch: props.onCatch,
509
+ children: ({
510
+ error
511
+ }) => {
512
+ if (error) {
513
+ return /*#__PURE__*/React__namespace.createElement(errorComponent, {
514
+ error
515
+ });
516
+ }
517
+ return props.children;
518
+ }
519
+ });
520
+ }
521
+ class CatchBoundaryImpl extends React__namespace.Component {
522
+ state = {
523
+ error: null
524
+ };
525
+ static getDerivedStateFromError(error) {
526
+ return {
527
+ error
528
+ };
529
+ }
530
+ componentDidUpdate(prevProps, prevState) {
531
+ if (prevState.error && prevProps.resetKey !== this.props.resetKey) {
532
+ this.setState({
533
+ error: null
534
+ });
535
+ }
536
+ }
537
+ componentDidCatch(error) {
538
+ this.props.onCatch?.(error);
539
+ }
540
+ render() {
541
+ return this.props.children(this.state);
542
+ }
543
+ }
544
+ function ErrorComponent({
545
+ error
546
+ }) {
547
+ const [show, setShow] = React__namespace.useState(process.env.NODE_ENV !== 'production');
548
+ return /*#__PURE__*/React__namespace.createElement("div", {
549
+ style: {
550
+ padding: '.5rem',
551
+ maxWidth: '100%'
552
+ }
553
+ }, /*#__PURE__*/React__namespace.createElement("div", {
554
+ style: {
555
+ display: 'flex',
556
+ alignItems: 'center',
557
+ gap: '.5rem'
558
+ }
559
+ }, /*#__PURE__*/React__namespace.createElement("strong", {
560
+ style: {
561
+ fontSize: '1rem'
562
+ }
563
+ }, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("button", {
564
+ style: {
565
+ appearance: 'none',
566
+ fontSize: '.6em',
567
+ border: '1px solid currentColor',
568
+ padding: '.1rem .2rem',
569
+ fontWeight: 'bold',
570
+ borderRadius: '.25rem'
571
+ },
572
+ onClick: () => setShow(d => !d)
573
+ }, show ? 'Hide Error' : 'Show Error')), /*#__PURE__*/React__namespace.createElement("div", {
574
+ style: {
575
+ height: '.25rem'
576
+ }
577
+ }), show ? /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", {
578
+ style: {
579
+ fontSize: '.7em',
580
+ border: '1px solid red',
581
+ borderRadius: '.25rem',
582
+ padding: '.3rem',
583
+ color: 'red',
584
+ overflow: 'auto'
585
+ }
586
+ }, error.message ? /*#__PURE__*/React__namespace.createElement("code", null, error.message) : null)) : null);
587
+ }
588
+ function useBlocker(message, condition = true) {
589
+ const router = useRouter();
590
+ React__namespace.useEffect(() => {
591
+ if (!condition) return;
592
+ let unblock = router.history.block((retry, cancel) => {
593
+ if (window.confirm(message)) {
594
+ unblock();
595
+ retry();
596
+ }
597
+ });
598
+ return unblock;
599
+ });
600
+ }
601
+ function Block({
602
+ message,
603
+ condition,
604
+ children
605
+ }) {
606
+ useBlocker(message, condition);
607
+ return children ?? null;
608
+ }
609
+ function shallow(objA, objB) {
610
+ if (Object.is(objA, objB)) {
611
+ return true;
612
+ }
613
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
614
+ return false;
615
+ }
616
+ const keysA = Object.keys(objA);
617
+ if (keysA.length !== Object.keys(objB).length) {
618
+ return false;
619
+ }
620
+ for (let i = 0; i < keysA.length; i++) {
621
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {
622
+ return false;
623
+ }
624
+ }
625
+ return true;
626
+ }
627
+
628
+ exports.Block = Block;
629
+ exports.CatchBoundary = CatchBoundary;
630
+ exports.CatchBoundaryImpl = CatchBoundaryImpl;
631
+ exports.ErrorComponent = ErrorComponent;
632
+ exports.Link = Link;
633
+ exports.MatchRoute = MatchRoute;
634
+ exports.Navigate = Navigate;
635
+ exports.Outlet = Outlet;
636
+ exports.RouterProvider = RouterProvider;
637
+ exports.lazyRouteComponent = lazyRouteComponent;
638
+ exports.matchIdsContext = matchIdsContext;
639
+ exports.routerContext = routerContext;
640
+ exports.shallow = shallow;
641
+ exports.useBlocker = useBlocker;
642
+ exports.useDehydrate = useDehydrate;
643
+ exports.useHydrate = useHydrate;
644
+ exports.useInjectHtml = useInjectHtml;
645
+ exports.useLinkProps = useLinkProps;
646
+ exports.useLoader = useLoader;
647
+ exports.useMatch = useMatch;
648
+ exports.useMatchRoute = useMatchRoute;
649
+ exports.useMatches = useMatches;
650
+ exports.useNavigate = useNavigate;
651
+ exports.useParams = useParams;
652
+ exports.useRouteContext = useRouteContext;
653
+ exports.useRouter = useRouter;
654
+ exports.useRouterContext = useRouterContext;
655
+ exports.useRouterState = useRouterState;
656
+ exports.useSearch = useSearch;
657
+ //# sourceMappingURL=react.js.map