` the `"Home"` string will be rendered no mather what because `*` matches every route.
227 |
228 | ### Base
229 |
230 | ```jsx
231 |
232 | ```
233 |
234 | It specifies the root of your application. If you deploy you code at specific path you have to either use this component or [`configureRouter`](#configurerouter) to tell Navigo where to start from.
235 |
236 | | Prop | type | required | Description |
237 | | ---- | ---- | -------- | ----------- |
238 | | **path** | string | yes | The root of your application. |
239 |
240 | ### NotFound
241 |
242 | ```jsx
243 | I'm 404 page.
244 | ```
245 |
246 | It renders its content in case of a no match is found.
247 |
248 | ### Redirect
249 |
250 | ```jsx
251 |
252 | ```
253 |
254 | It indirectly calls the `navigate` method of the router. Checkout [redirecting](#redirecting) example below.
255 |
256 | | Prop | type | required | Description |
257 | | ---- | ---- | -------- | ----------- |
258 | | **path** | string | yes | The path where you want to go to. |
259 |
260 | ## Hooks
261 |
262 | ### useNavigo
263 |
264 | `useNavigo` is a hook that gives you access to the Navigo context. The main role of the context is to pass a [Match](https://github.com/krasimir/navigo/blob/master/DOCUMENTATION.md#match) object. It gives you access to the matched URL, URL and GET parameters. For example:
265 |
266 | ```js
267 | import { Route, useNavigo } from "navigo-react";
268 |
269 | function User() {
270 | const { match } = useNavigo();
271 |
272 | return (
273 |
274 | {match.params.action} user with id {match.data.id}
275 |
276 | );
277 | }
278 |
279 | export default function App() {
280 | return (
281 | <>
282 |
283 | Click me
284 |
285 |
286 |
287 |
288 | >
289 | );
290 | }
291 | ```
292 |
293 | The Navigo context also gives you access to key-value paris that we send via the router [lifecycle functions](#route-lifecycle-functions). Check out this example [Get data required by a Route](#get-data-required-by-a-route).
294 |
295 | ### useLocation
296 |
297 | `useLocation` gives you a [Match](https://github.com/krasimir/navigo/blob/master/DOCUMENTATION.md#match) object that represents the current URL of the browser.
298 |
299 | ```js
300 | const match = useLocation();
301 | ```
302 |
303 | ## Other functions
304 |
305 | ### configureRouter
306 |
307 | `configureRouter` could be used outside React and its purpose is to set the base root path of the router. Same as [` `](#base) component.
308 |
309 | ```js
310 | configureRouter('/my/app');
311 | ```
312 |
313 | ### reset
314 |
315 | Calling this function means flushing all the registered routes.
316 |
317 | ### getRouter
318 |
319 | It gives you access to the [Navigo](https://github.com/krasimir/navigo/blob/master/DOCUMENTATION.md) router. Mostly you'll be using `navigate` and `navigateByName` functions. For example:
320 |
321 | ```js
322 | getRouter().navigate('/users/list');
323 | ```
324 |
325 | ## Examples
326 |
327 | ### Basic example
328 |
329 | ```jsx
330 | import { Switch, Route } from "navigo-react";
331 |
332 | export default function App() {
333 | return (
334 | <>
335 |
336 | Home
337 | Package
338 |
339 |
340 |
341 |
342 | Size: ~15KB
343 | Dependencies: no
344 |
345 | Documentation: here
346 |
347 |
348 |
349 |
350 | NavigoReact is a router for React applications based on Navigo project.
351 |
352 |
353 | >
354 | );
355 | }
356 | ```
357 |
358 | https://codesandbox.io/s/navigo-react-example-w9l1d
359 |
360 | ### Accessing URL and GET parameters
361 |
362 | ```jsx
363 | import { Route, useNavigo } from "navigo-react";
364 |
365 | function User() {
366 | const { match } = useNavigo();
367 |
368 | return (
369 |
370 | {match.params.action} user with id {match.data.id}
371 |
372 | );
373 | }
374 |
375 | export default function App() {
376 | return (
377 | <>
378 |
379 | Click me
380 |
381 |
382 |
383 |
384 | >
385 | );
386 | }
387 | ```
388 |
389 | https://codesandbox.io/s/navigo-url-and-get-parameters-5few6
390 |
391 | ### Redirecting
392 |
393 | ```jsx
394 | import { Route, Switch, Redirect } from "navigo-react";
395 |
396 | export default function App() {
397 | return (
398 | <>
399 |
400 |
401 | View user
402 |
403 |
404 |
405 |
406 |
407 |
408 | Hey user!
409 |
410 | >
411 | );
412 | }
413 | ```
414 |
415 | https://codesandbox.io/s/navigo-redirecting-cxzbb
416 |
417 | ### Get data required by a Route
418 |
419 | ```jsx
420 | import { Route, useNavigo } from "navigo-react";
421 |
422 | function Print() {
423 | const { pic } = useNavigo();
424 |
425 | if (pic === null) {
426 | return Loading ...
;
427 | }
428 | return ;
429 | }
430 |
431 | export default function App() {
432 | async function before({ render, done }) {
433 | render({ pic: null });
434 | const res = await (
435 | await fetch("https://api.thecatapi.com/v1/images/search")
436 | ).json();
437 | render({ pic: res[0].url });
438 | done();
439 | }
440 | return (
441 | <>
442 |
443 |
444 | Get a cat fact
445 |
446 |
447 |
448 |
449 |
450 | >
451 | );
452 | }
453 | ```
454 |
455 | https://codesandbox.io/s/navigo-before-lifecycle-function-hgeld
456 |
457 | ### Block opening a route
458 |
459 | The user can't go to `/user` route.
460 |
461 | ```jsx
462 | import { Route } from "navigo-react";
463 |
464 | export default function App() {
465 | const before = ({ done }) => {
466 | done(false);
467 | };
468 |
469 | return (
470 | <>
471 |
472 |
473 | Access user
474 |
475 |
476 |
477 | Hey user!!!
478 |
479 | >
480 | );
481 | }
482 | ```
483 |
484 | https://codesandbox.io/s/navigo-block-routing-e2qvw
485 |
486 | ### Handling transitions
487 |
488 | ```jsx
489 | import { Route, Switch, useNavigo } from "navigo-react";
490 |
491 | const delay = (time) => new Promise((done) => setTimeout(done, time));
492 |
493 | const leaveHook = async ({ render, done }) => {
494 | render({ leaving: true });
495 | await delay(900);
496 | done();
497 | };
498 |
499 | function Card({ children, bgColor }) {
500 | const { leaving } = useNavigo();
501 | const animation = `${
502 | leaving ? "out" : "in"
503 | } 1000ms cubic-bezier(1, -0.28, 0.28, 1.49)`;
504 |
505 | return (
506 |
512 | );
513 | }
514 |
515 | export default function App() {
516 | return (
517 | <>
518 |
519 |
520 |
521 | Card #2.
522 |
523 |
524 | Click here
525 | {" "}
526 | to go back
527 |
528 |
529 |
530 |
531 | Welcome to the transition example.{" "}
532 |
533 | Click here
534 | {" "}
535 | to open the other card.
536 |
537 |
538 |
539 | >
540 | );
541 | }
542 | ```
543 |
544 | https://codesandbox.io/s/navigo-handling-transitions-ipprc
--------------------------------------------------------------------------------
/src/__tests__/Route.spec.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from "react";
2 | import "@testing-library/jest-dom/extend-expect";
3 | import { render, waitFor, fireEvent, screen } from "@testing-library/react";
4 | import { getRouter, reset, Route, useNavigo, Base, configureRouter, Switch } from "../NavigoReact";
5 |
6 | import { expectContent, navigate, delay } from "../__tests_helpers__/utils";
7 |
8 | let warn: jest.SpyInstance;
9 |
10 | describe("Given navigo-react", () => {
11 | beforeEach(() => {
12 | reset();
13 | warn = jest.spyOn(console, "warn").mockImplementation(() => {});
14 | history.pushState({}, "", "/");
15 | });
16 | afterEach(() => {
17 | if (warn) {
18 | warn.mockReset();
19 | }
20 | });
21 | describe("when using the Route component", () => {
22 | it("should render the children if the path matches on the first render", async () => {
23 | history.pushState({}, "", "/app/foo/bar");
24 | function CompA() {
25 | const { match } = useNavigo();
26 | if (match) {
27 | return A
;
28 | }
29 | return null;
30 | }
31 |
32 | render(
33 |
34 |
35 |
36 |
37 |
38 |
39 | B
40 |
41 |
42 | );
43 | expectContent("AB");
44 | });
45 | it("should gives us access to the Match object", () => {
46 | history.pushState({}, "", "/foo/bar");
47 | const CompB = jest.fn().mockImplementation(() => {
48 | const { match } = useNavigo();
49 | // @ts-ignore
50 | return B{match.data.id}
;
51 | });
52 | render(
53 |
54 |
55 |
56 |
57 |
58 | );
59 |
60 | expect(CompB).toBeCalledTimes(1);
61 | expect(CompB.mock.calls[0][0]).toStrictEqual({
62 | a: "b",
63 | });
64 | });
65 | it("should add a route and remove it when we unmount the component", async () => {
66 | function Wrapper() {
67 | const [count, setCount] = useState(0);
68 | if (count >= 2 && count < 4) {
69 | return (
70 | <>
71 |
72 |
73 |
74 | setCount(count + 1)}>button
75 | >
76 | );
77 | }
78 | return setCount(count + 1)}>button ;
79 | }
80 | function Comp() {
81 | const { match } = useNavigo();
82 | return match ? Match
: No Match
;
83 | }
84 |
85 | const { getByText } = render(
86 |
87 |
88 |
89 | );
90 |
91 | fireEvent.click(getByText("button"));
92 | fireEvent.click(getByText("button"));
93 | fireEvent.click(getByText("button"));
94 | expect(getRouter().routes).toHaveLength(1);
95 | await waitFor(() => {
96 | navigate("/foo");
97 | });
98 | expectContent("Matchbutton");
99 | await waitFor(() => {
100 | fireEvent.click(getByText("button"));
101 | });
102 | await waitFor(() => {
103 | fireEvent.click(getByText("button"));
104 | fireEvent.click(getByText("button"));
105 | });
106 | expectContent("button");
107 | expect(getRouter().routes).toHaveLength(0);
108 | });
109 | it("should give us proper Match object if the path matches on the first render", async () => {
110 | history.pushState({}, "", "/foo/bar");
111 | function Comp() {
112 | const { match } = useNavigo();
113 | if (match) {
114 | // @ts-ignore
115 | return Matching {match.data.id}
;
116 | }
117 | return Nope
;
118 | }
119 |
120 | render(
121 |
122 |
123 |
124 |
125 |
126 | );
127 | expectContent("Matching bar");
128 | });
129 | describe("and we have multiple components", () => {
130 | it("should properly resolve the paths", async () => {
131 | function CompA() {
132 | const { match } = useNavigo();
133 | if (match) {
134 | // @ts-ignore
135 | return About
;
136 | }
137 | return null;
138 | }
139 | function CompB() {
140 | const { match } = useNavigo();
141 | if (match) {
142 | // @ts-ignore
143 | return Products
;
144 | }
145 | return null;
146 | }
147 |
148 | render(
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | );
158 | expect(screen.getByTestId("container").textContent).toEqual("");
159 | await navigate("/about");
160 | expect(screen.getByTestId("container").textContent).toEqual("About");
161 | await navigate("products");
162 | expect(screen.getByTestId("container").textContent).toEqual("Products");
163 | });
164 | it("should resolve even tho there is the same path in multiple components", async () => {
165 | function CompA() {
166 | const { match } = useNavigo();
167 | if (match) {
168 | // @ts-ignore
169 | return About1
;
170 | }
171 | return null;
172 | }
173 | function CompB() {
174 | const { match } = useNavigo();
175 | if (match) {
176 | // @ts-ignore
177 | return About2
;
178 | }
179 | return null;
180 | }
181 |
182 | render(
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 | );
192 | expectContent("");
193 | await navigate("/about");
194 | expectContent("About1About2");
195 | await navigate("products");
196 | expectContent("");
197 | });
198 | });
199 | describe("and when we have links with data-navigo attribute", () => {
200 | it("should properly navigate to the new route", async () => {
201 | configureRouter("/app");
202 | function CompA() {
203 | return (
204 |
205 | click me
206 |
207 | );
208 | }
209 | function CompB() {
210 | const { match } = useNavigo();
211 | if (match) {
212 | // @ts-ignore
213 | return (
214 | <>
215 | About
216 |
217 | home
218 |
219 | >
220 | );
221 | }
222 | return null;
223 | }
224 |
225 | const { getByText } = render(
226 |
227 |
228 |
229 |
230 |
231 |
232 | );
233 | expectContent("click me");
234 | fireEvent.click(getByText("click me"));
235 | expectContent("click meAbouthome");
236 | await delay();
237 | fireEvent.click(getByText("home"));
238 | expectContent("click me");
239 | });
240 | });
241 | });
242 | describe("when passing a `before` function", () => {
243 | it("should create a before hook and allow us render with specific args", async () => {
244 | const handler = jest.fn().mockImplementation(async ({ render, done }) => {
245 | render({ myName: "Krasimir" });
246 | await delay(5);
247 | waitFor(() => {
248 | render({ myName: "Tsonev" });
249 | });
250 | await delay(5);
251 | waitFor(() => {
252 | done();
253 | });
254 | });
255 | history.pushState({}, "", "/about");
256 | function Comp() {
257 | const { match, myName } = useNavigo();
258 |
259 | if (match) {
260 | return Hello, {myName}
;
261 | }
262 | return Nope
;
263 | }
264 |
265 | render(
266 |
267 |
268 |
269 |
270 |
271 | );
272 |
273 | expectContent("Hello, Krasimir");
274 | await delay(7);
275 | expectContent("Hello, Tsonev");
276 | await delay(20);
277 | expectContent("Hello, Tsonev");
278 | expect(handler).toBeCalledTimes(1);
279 | expect(handler).toBeCalledWith({
280 | render: expect.any(Function),
281 | done: expect.any(Function),
282 | match: expect.objectContaining({ url: "about" }),
283 | });
284 | });
285 | it("should allow us to block the routing", async () => {
286 | history.pushState({}, "", "/");
287 | function Comp() {
288 | return About
;
289 | }
290 |
291 | render(
292 |
293 | {
296 | done(false);
297 | }}
298 | >
299 |
300 |
301 |
302 | );
303 |
304 | expectContent("");
305 | getRouter().navigate("/about");
306 | expectContent("");
307 | expect(location.pathname).toEqual("/");
308 | });
309 | it("should accumulate state", async () => {
310 | history.pushState({}, "", "/about");
311 | const spy = jest.fn();
312 | function Comp() {
313 | spy(useNavigo());
314 |
315 | return Hey
;
316 | }
317 |
318 | render(
319 |
320 | {
323 | render({ a: "b" });
324 | await delay(2);
325 | waitFor(() => {
326 | render({ c: "d" });
327 | });
328 | await delay(2);
329 | waitFor(() => {
330 | done();
331 | });
332 | }}
333 | >
334 |
335 |
336 |
337 | );
338 |
339 | await delay(20);
340 | expect(spy).toBeCalledTimes(3);
341 | expect(spy.mock.calls[0][0]).toStrictEqual({
342 | match: expect.objectContaining({ url: "about" }),
343 | a: "b",
344 | __allowRender: true,
345 | });
346 | expect(spy.mock.calls[1][0]).toStrictEqual({
347 | match: expect.objectContaining({ url: "about" }),
348 | a: "b",
349 | c: "d",
350 | __allowRender: true,
351 | });
352 | expect(spy.mock.calls[2][0]).toStrictEqual({
353 | match: expect.objectContaining({ url: "about" }),
354 | a: "b",
355 | c: "d",
356 | __allowRender: true,
357 | });
358 | });
359 | it("should keep the scope of the before hook and give access to the latest state values", () => {
360 | history.pushState({}, "", "/");
361 | const spy = jest.fn();
362 | function Comp() {
363 | const [count, setCount] = useState(0);
364 | const before = ({ done }: { done: Function }) => {
365 | spy(count);
366 | done();
367 | };
368 |
369 | return (
370 | <>
371 |
372 | about
373 |
374 |
375 | About page
376 |
377 | setCount(count + 1)} data-testid="c">
378 | click me {count}
379 |
380 | >
381 | );
382 | }
383 | const { getByTestId, getByText } = render(
384 |
385 |
386 |
387 | );
388 |
389 | fireEvent.click(getByTestId("c"));
390 | fireEvent.click(getByTestId("c"));
391 | fireEvent.click(getByTestId("c"));
392 | expectContent("aboutclick me 3");
393 | fireEvent.click(getByText("about"));
394 | expect(spy).toBeCalledTimes(1);
395 | expect(spy).toBeCalledWith(3);
396 | });
397 | it("should keep the scope of the after hook and give access to the latest state values", () => {
398 | history.pushState({}, "", "/");
399 | const spy = jest.fn();
400 | function Comp() {
401 | const [count, setCount] = useState(0);
402 | const after = ({ render }: { render: Function }) => {
403 | spy(count);
404 | };
405 |
406 | return (
407 | <>
408 |
409 | about
410 |
411 |
412 | About
413 |
414 | setCount(count + 1)} data-testid="c">
415 | click me {count}
416 |
417 | >
418 | );
419 | }
420 | const { getByTestId, getByText } = render(
421 |
422 |
423 |
424 | );
425 |
426 | fireEvent.click(getByTestId("c"));
427 | fireEvent.click(getByTestId("c"));
428 | fireEvent.click(getByTestId("c"));
429 | expectContent("aboutclick me 3");
430 | fireEvent.click(getByText("about"));
431 | expect(spy).toBeCalledTimes(1);
432 | expect(spy).toBeCalledWith(3);
433 | expectContent("aboutAboutclick me 3");
434 | });
435 | it("should keep the scope of the already hook and give access to the latest state values", () => {
436 | history.pushState({}, "", "/");
437 | const spy = jest.fn();
438 | function Comp() {
439 | const [count, setCount] = useState(0);
440 | const already = ({ render }: { render: Function }) => {
441 | spy(count);
442 | };
443 |
444 | return (
445 | <>
446 |
447 | about
448 |
449 |
450 | About
451 |
452 | setCount(count + 1)} data-testid="c">
453 | click me {count}
454 |
455 | >
456 | );
457 | }
458 | const { getByTestId, getByText } = render(
459 |
460 |
461 |
462 | );
463 |
464 | fireEvent.click(getByTestId("c"));
465 | fireEvent.click(getByTestId("c"));
466 | fireEvent.click(getByTestId("c"));
467 | expectContent("aboutclick me 3");
468 | fireEvent.click(getByText("about"));
469 | fireEvent.click(getByText("about"));
470 | expect(spy).toBeCalledTimes(1);
471 | expect(spy).toBeCalledWith(3);
472 | expectContent("aboutAboutclick me 3");
473 | });
474 | it("should keep the scope of the leave hook and give access to the latest state values", () => {
475 | history.pushState({}, "", "/about");
476 | const spy = jest.fn();
477 | function Comp() {
478 | const [count, setCount] = useState(0);
479 | const leave = ({ render, done }: { done: Function; render: Function }) => {
480 | spy(count);
481 | };
482 |
483 | return (
484 | <>
485 |
486 | About
487 |
488 | setCount(count + 1)} data-testid="c">
489 | click me {count}
490 |
491 | >
492 | );
493 | }
494 | const { getByTestId } = render(
495 |
496 |
497 |
498 | );
499 |
500 | fireEvent.click(getByTestId("c"));
501 | fireEvent.click(getByTestId("c"));
502 | fireEvent.click(getByTestId("c"));
503 | expectContent("Aboutclick me 3");
504 | getRouter().navigate("/nope");
505 | expect(spy).toBeCalledTimes(1);
506 | expect(spy).toBeCalledWith(3);
507 | });
508 | });
509 | describe("when passing `after`", () => {
510 | it("should create an after hook and allow us to send props to useNavigo hook", async () => {
511 | history.pushState({}, "", "/about");
512 | function Comp() {
513 | const { match, userName } = useNavigo();
514 |
515 | if (userName) {
516 | return Hey, {userName}
;
517 | }
518 | return Nope
;
519 | }
520 |
521 | render(
522 |
523 | {
526 | await delay(10);
527 | await waitFor(() => {
528 | render({ userName: "Foo Bar" });
529 | });
530 | }}
531 | >
532 |
533 |
534 |
535 | );
536 |
537 | expectContent("Nope");
538 | await delay(20);
539 | expectContent("Hey, Foo Bar");
540 | });
541 | });
542 | describe("when passing `already`", () => {
543 | it("should create an already hook and allow us to send props to useNavigo hook", async () => {
544 | history.pushState({}, "", "/about");
545 | function Comp() {
546 | const { again } = useNavigo();
547 |
548 | if (again) {
549 | return Rendering again
;
550 | }
551 | return Nope
;
552 | }
553 |
554 | render(
555 |
556 | {
559 | render({ again: true });
560 | }}
561 | >
562 |
563 |
564 |
565 | );
566 |
567 | expectContent("Nope");
568 | await waitFor(() => {
569 | getRouter().navigate("/about");
570 | });
571 | expectContent("Rendering again");
572 | });
573 | });
574 | describe("when passing a `leave` function", () => {
575 | it("should create a leave hook and allow us to send props to useNavigo hook", async () => {
576 | history.pushState({}, "", "/about");
577 | function Comp() {
578 | const { leaving } = useNavigo();
579 |
580 | if (leaving) {
581 | return Leaving...
;
582 | }
583 | return Nope
;
584 | }
585 |
586 | render(
587 |
588 | {
591 | render({ leaving: true });
592 | await delay(10);
593 | waitFor(() => {
594 | render({ leaving: false });
595 | done();
596 | });
597 | }}
598 | >
599 |
600 |
601 |
602 | );
603 |
604 | expectContent("Nope");
605 | await waitFor(() => {
606 | getRouter().navigate("/nah");
607 | });
608 | expectContent("Leaving...");
609 | await delay(20);
610 | expectContent("Nope");
611 | });
612 | it("should allow us to block the routing", async () => {
613 | history.pushState({}, "", "/about");
614 | function Comp() {
615 | return Not leaving!
;
616 | }
617 |
618 | render(
619 |
620 | {
623 | done(false);
624 | }}
625 | >
626 |
627 |
628 |
629 | );
630 |
631 | expectContent("Not leaving!");
632 | await waitFor(() => {
633 | getRouter().navigate("/nah");
634 | });
635 | expectContent("Not leaving!");
636 | expect(location.pathname).toEqual("/about");
637 | });
638 | });
639 | describe("when passing a name", () => {
640 | it("should be possible to navigate to that same route later", async () => {
641 | history.pushState({}, "", "/");
642 | function Users() {
643 | const { match } = useNavigo();
644 | // @ts-ignore
645 | return Hello, {match.data.name}
;
646 | }
647 |
648 | render(
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 | );
657 |
658 | expectContent("");
659 | await waitFor(() => {
660 | getRouter().navigateByName("user", { name: "krasimir" });
661 | });
662 | expectContent("Hello, krasimir");
663 | });
664 | });
665 | });
666 |
--------------------------------------------------------------------------------
/lib/NavigoReact.min.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["webpack://NavigoReact/webpack/universalModuleDefinition","webpack://NavigoReact/webpack/bootstrap","webpack://NavigoReact/external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"React\",\"root\":\"React\"}","webpack://NavigoReact/./node_modules/navigo/lib/navigo.min.js","webpack://NavigoReact/./src/NavigoReact.tsx"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","783","e","default","H","a","location","pathname","search","hash","replace","u","split","slice","join","h","length","decodeURIComponent","Array","isArray","push","f","path","url","queryString","route","data","params","v","RegExp","g","match","reduce","window","history","pushState","filter","forEach","splice","apply","concat","currentLocationPath","instance","_checkForAHash","y","routes","matches","resolveOptions","strategy","O","navigateOptions","shouldResolve","console","warn","silent","k","force","_setCurrent","_pathToMatchObject","to","if","L","b","w","historyAPIMethod","stateObj","title","setTimeout","href","P","lastResolved","map","hooks","leave","matchLocation","find","A","already","before","handler","updatePageLinks","after","_","_notFoundRoute","notFoundHandled","noMatchWarning","R","assign","arguments","E","indexOf","S","String","x","j","N","document","querySelectorAll","getAttribute","hasListenerAttached","navigoHandler","ctrlKey","metaKey","target","tagName","toLowerCase","URL","preventDefault","stopPropagation","navigate","addEventListener","removeEventListener","C","U","q","F","destroyed","current","on","keys","uses","as","off","resolve","navigateByName","destroy","__popstateListener","notFound","link","extractGETParameters","generate","getLinkPath","getCurrentLocation","addBeforeHook","addAfterHook","addAlreadyHook","addLeaveHook","getRoute","_clean","router","Context","createContext","SwitchContext","isInSwitch","switchMatch","getRouter","nextTick","callback","configureRouter","reset","undefined","Route","children","context","setContext","state","action","switchContext","renderChild","Provider","noneBlockingHook","func","render","result","blockingHook","done","__allowRender","isMounted","navigoRoute","Base","Switch","setMatch","switchHandler","Date","getTime","NotFound","useNotFound","Redirect","useNavigo","useLocation","API"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,UACR,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,cAAe,CAAC,SAAUJ,GACP,iBAAZC,QACdA,QAAqB,YAAID,EAAQG,QAAQ,UAEzCJ,EAAkB,YAAIC,EAAQD,EAAY,OAR5C,CASmB,oBAATO,KAAuBA,KAAOC,MAAM,SAASC,GACvD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUV,QAGnC,IAAIC,EAASO,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHZ,QAAS,IAUV,OANAa,EAAQH,GAAUI,KAAKb,EAAOD,QAASC,EAAQA,EAAOD,QAASS,GAG/DR,EAAOW,GAAI,EAGJX,EAAOD,QA0Df,OArDAS,EAAoBM,EAAIF,EAGxBJ,E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AAQ1H,MACjB,OAAO+H,IAET,OAAO,KAEF,SAASW,GAAK,KAAEnJ,IAErB,OADA2H,EAAU3H,GACH,KAEF,SAASoJ,GAAO,SAAElB,IACvB,MAAOzH,EAAO4I,GAAY,oBAAwB,GAUlD,OATA,oBAAU,KACR,SAASC,EAAc7I,GACrB4I,EAAS5I,GAGX,OADAkH,IAAY3B,GAAG,IAAKsD,GACb,KACL3B,IAAYvB,IAAIkD,KAEjB,IAED,kBAAC9B,EAAciB,SAAQ,CACrB7K,MAAO,CAAE8J,aAAa,EAAOD,YAAY,GACzCvJ,IAAKuC,EAAQA,EAAMR,IAAM,UAAS,IAAIsJ,MAAOC,WAE5CtB,GAIA,SAASuB,GAAS,SAAEvB,EAAQ,MAAEhF,IACnC,MAAMzC,EAuBR,SAAqByC,GACnB,MAAOzC,EAAO4I,GAAY,oBAAwB,GAC5C5F,EAAU,iBAAQhD,IACtB4I,EAAS5I,GACTmH,EAAS,IAAMD,IAAYjE,qBAkB7B,OAfA,oBAAU,KAER,MAAM2D,EAASM,IAQf,OAPAN,EAAOZ,SAAShD,EAAQsC,QAAS7C,GACjCmE,EAAOH,aAAa,gBAAkB6B,IACpCM,GAAS,GACTN,MAEF1B,EAAOhB,UACPgB,EAAO3D,kBACA,KACL2D,EAAOjB,IAAI3C,EAAQsC,WAEpB,IAEItF,EA7COiJ,CAAYxG,GAE1B,OAAIzC,EACK,kBAAC6G,EAAQmB,SAAQ,CAAC7K,MAAO,CAAE6C,UAAUyH,GAEvC,KAEF,SAASyB,GAAS,KAAE3J,IAIzB,OAHA,oBAAU,KACR2H,IAAYpC,SAASvF,IACpB,IACI,KAIF,SAAS4J,IACd,OAAO,qBAAWtC,GAEb,SAASuC,IACd,OAAOlC,IAAYb,qBA6BrB,MAAMgD,EAAM,CACVnC,YACAG,kBACAC,QACAE,QACAkB,OACAC,SACAK,WACAE,WACAC,YACAC,eAGa,e","file":"NavigoReact.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"NavigoReact\", [\"React\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"NavigoReact\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"NavigoReact\"] = factory(root[\"React\"]);\n})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","!function(t,n){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(\"Navigo\",[],n):\"object\"==typeof exports?exports.Navigo=n():t.Navigo=n()}(\"undefined\"!=typeof self?self:this,(function(){return(()=>{\"use strict\";var t={783:(t,n,e)=>{e.d(n,{default:()=>H});var o=/([:*])(\\w+)/g,r=/\\*/g,a=/\\/\\?/g;function i(t){return void 0===t&&(t=\"/\"),d()?location.pathname+location.search+location.hash:t}function s(t){return t.replace(/\\/+$/,\"\").replace(/^\\/+/,\"\")}function c(t){return\"string\"==typeof t}function u(t){var n=s(t).split(/\\?(.*)?$/);return[s(n[0]),n.slice(1).join(\"\")]}function h(t){for(var n={},e=t.split(\"&\"),o=0;o0?1===t.matches.length?t.matches[0]:t.matches:void 0)}})).concat([function(){return o()}])):o()}else o()}})),{},(function(){return n()})):n()}var A=[function(t,n){var e=t.instance.lastResolved();if(e&&e[0]&&e[0].route===t.match.route&&e[0].url===t.match.url&&e[0].queryString===t.match.queryString)return e.forEach((function(n){n.route.hooks&&n.route.hooks.already&&p(t.navigateOptions,\"callHooks\")&&n.route.hooks.already.forEach((function(n){return n(t.match)}))})),void n(!1);n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.before&&p(t.navigateOptions,\"callHooks\")?g(t.match.route.hooks.before.map((function(n){return function(e,o){return n(o,t.match)}})).concat([function(){return n()}])):n()},function(t,n){p(t.navigateOptions,\"callHandler\")&&t.match.route.handler(t.match),t.instance.updatePageLinks(),n()},function(t,n){t.match.route.hooks&&t.match.route.hooks.after&&p(t.navigateOptions,\"callHooks\")&&t.match.route.hooks.after.forEach((function(n){return n(t.match)})),n()}],_=[P,function(t,n){var e=t.instance._notFoundRoute;if(e){t.notFoundHandled=!0;var o=u(t.currentLocationPath),r=o[0],a=o[1];e.path=s(r);var i={url:e.path,queryString:a,data:null,route:e,params:\"\"!==a?h(a):null};t.matches=[i],t.match=i}n()},g.if((function(t){return t.notFoundHandled}),A,[function(t,n){t.resolveOptions&&!1!==t.resolveOptions.noMatchWarning&&void 0!==t.resolveOptions.noMatchWarning||console.warn('Navigo: \"'+t.currentLocationPath+\"\\\" didn't match any of the registered routes.\"),n()}]),function(t,n){t.instance._setCurrent(null),n()}];function R(){return(R=Object.assign||function(t){for(var n=1;n=0&&(t=!0===o.hash?t.split(\"#\")[1]||\"/\":t.split(\"#\")[0]),t}function H(t){return s(a+\"/\"+s(t))}function S(t,n,e,o){return t=c(t)?H(t):t,{name:o||s(String(t)),path:t,handler:n,hooks:v(e)}}function x(t,n){var e={instance:r,currentLocationPath:t?s(a)+\"/\"+s(t):void 0,navigateOptions:{},resolveOptions:n||o};return g([m,y,g.if((function(t){var n=t.matches;return n&&n.length>0}),E,_)],e),!!e.matches&&e.matches}function j(t,n){t=s(a)+\"/\"+s(t);var e={instance:r,to:t,navigateOptions:n||{},resolveOptions:n&&n.resolveOptions?n.resolveOptions:o,currentLocationPath:R(t)};g([O,k,y,g.if((function(t){var n=t.matches;return n&&n.length>0}),E,_),w],e)}function N(){if(A)return(A?[].slice.call(document.querySelectorAll(\"[data-navigo]\")):[]).forEach((function(t){\"false\"!==t.getAttribute(\"data-navigo\")&&\"_blank\"!==t.getAttribute(\"target\")?t.hasListenerAttached||(t.hasListenerAttached=!0,t.navigoHandler=function(n){if((n.ctrlKey||n.metaKey)&&\"a\"===n.target.tagName.toLowerCase())return!1;var e=t.getAttribute(\"href\");if(null==e)return!1;if(e.match(/^(http|https)/)&&\"undefined\"!=typeof URL)try{var o=new URL(e);e=o.pathname+o.search}catch(t){}var a=function(t){if(!t)return{};var n,e=t.split(\",\"),o={};return e.forEach((function(t){var e=t.split(\":\").map((function(t){return t.replace(/(^ +| +$)/g,\"\")}));switch(e[0]){case\"historyAPIMethod\":o.historyAPIMethod=e[1];break;case\"resolveOptionsStrategy\":n||(n={}),n.strategy=e[1];break;case\"resolveOptionsHash\":n||(n={}),n.hash=\"true\"===e[1];break;case\"updateBrowserURL\":case\"callHandler\":case\"updateState\":case\"force\":o[e[0]]=\"true\"===e[1]}})),n&&(o.resolveOptions=n),o}(t.getAttribute(\"data-navigo-options\"));b||(n.preventDefault(),n.stopPropagation(),r.navigate(s(e),a))},t.addEventListener(\"click\",t.navigoHandler)):t.hasListenerAttached&&t.removeEventListener(\"click\",t.navigoHandler)})),r}function C(t,n){var e=L.find((function(n){return n.name===t}));if(e){var o=e.path;if(n)for(var r in n)o=o.replace(\":\"+r,n[r]);return o.match(/^\\//)?o:\"/\"+o}return null}function U(t){var n=u(s(t)),o=n[0],r=n[1],a=\"\"===r?null:h(r);return{url:o,queryString:r,route:S(o,(function(){}),[e],o),data:null,params:a}}function q(t,n,e){return\"string\"==typeof n&&(n=F(n)),n?(n.hooks[t]||(n.hooks[t]=[]),n.hooks[t].push(e),function(){n.hooks[t]=n.hooks[t].filter((function(t){return t!==e}))}):(console.warn(\"Route doesn't exists: \"+n),function(){})}function F(t){return\"string\"==typeof t?L.find((function(n){return n.name===H(t)})):L.find((function(n){return n.handler===t}))}t?a=s(t):console.warn('Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'),this.root=a,this.routes=L,this.destroyed=b,this.current=p,this.on=function(t,n,o){var r=this;return\"object\"!=typeof t||t instanceof RegExp?(\"function\"==typeof t&&(o=n,n=t,t=a),L.push(S(t,n,[e,o])),this):(Object.keys(t).forEach((function(n){if(\"function\"==typeof t[n])r.on(n,t[n]);else{var o=t[n],a=o.uses,i=o.as,s=o.hooks;L.push(S(n,a,[e,s],i))}})),this)},this.off=function(t){return this.routes=L=L.filter((function(n){return c(t)?s(n.path)!==s(t):\"function\"==typeof t?t!==n.handler:String(n.path)!==String(t)})),this},this.resolve=x,this.navigate=j,this.navigateByName=function(t,n,e){var o=C(t,n);return null!==o&&(j(o,e),!0)},this.destroy=function(){this.routes=L=[],P&&window.removeEventListener(\"popstate\",this.__popstateListener),this.destroyed=b=!0},this.notFound=function(t,n){return r._notFoundRoute=S(\"*\",t,[e,n],\"__NOT_FOUND__\"),this},this.updatePageLinks=N,this.link=function(t){return\"/\"+a+\"/\"+s(t)},this.hooks=function(t){return e=t,this},this.extractGETParameters=function(t){return u(R(t))},this.lastResolved=function(){return p},this.generate=C,this.getLinkPath=function(t){return t.getAttribute(\"href\")},this.match=function(t){var n={instance:r,currentLocationPath:t,navigateOptions:{},resolveOptions:o};return y(n,(function(){})),!!n.matches&&n.matches},this.matchLocation=function(t,n){var e={instance:r,currentLocationPath:n};return m(e,(function(){})),t=s(t),f(e.currentLocationPath,{name:t,path:t,handler:function(){},hooks:{}})||!1},this.getCurrentLocation=function(){return U(s(i(a)).replace(new RegExp(\"^\"+a),\"\"))},this.addBeforeHook=q.bind(this,\"before\"),this.addAfterHook=q.bind(this,\"after\"),this.addAlreadyHook=q.bind(this,\"already\"),this.addLeaveHook=q.bind(this,\"leave\"),this.getRoute=F,this._pathToMatchObject=U,this._clean=s,this._checkForAHash=R,this._setCurrent=function(t){return p=r.current=t},function(){P&&(this.__popstateListener=function(){x()},window.addEventListener(\"popstate\",this.__popstateListener))}.call(this),N.call(this)}}},n={};function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{}};return t[o](r,r.exports,e),r.exports}return e.d=(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e(783)})().default}));\n//# sourceMappingURL=navigo.min.js.map","import React, { useRef, useEffect, useState, useContext, useReducer } from \"react\";\nimport Navigo, { Match as NavigoMatch, RouteHooks as NavigoHooks, Route as NavigoRoute } from \"navigo\";\n// import Navigo, { Match as NavigoMatch, RouteHooks as NavigoHooks, Route as NavigoRoute } from \"../../navigo\";\n\nimport { RouteProps, Path, NotFoundRouteProps, NavigoSwitchContextType, NavigoRouting } from \"../index.d\";\n\nlet router: Navigo | undefined;\nlet Context = React.createContext({ match: false } as NavigoRouting);\nlet SwitchContext = React.createContext({ isInSwitch: false, switchMatch: false } as NavigoSwitchContextType);\n\n// types\nexport type Match = NavigoMatch;\nexport type RouteHooks = NavigoHooks;\n\nexport function getRouter(root?: string): Navigo {\n if (router) {\n return router;\n }\n // @ts-ignore\n router = window.R = new Navigo(root || \"/\", { strategy: \"ALL\", noMatchWarning: true });\n // @ts-ignore\n window.router = router;\n return router;\n}\nfunction nextTick(callback: Function) {\n setTimeout(() => callback(), 0);\n}\n\n// utils\nexport function configureRouter(root: string) {\n return getRouter(root);\n}\nexport function reset() {\n if (router) {\n router.destroy();\n router = undefined;\n }\n}\n\n// components\nexport function Route({ path, children, before, after, already, leave, name }: RouteProps) {\n const route = useRef(undefined);\n const [context, setContext] = useReducer((state: NavigoRouting, action: NavigoRouting) => ({ ...state, ...action }), {\n match: false,\n });\n const switchContext = useContext(SwitchContext);\n const renderChild = () => {children} ;\n const noneBlockingHook = (func: Function) => (match: Match) => {\n func({\n render: (result: any) => setContext({ ...result, match }),\n match,\n });\n };\n const blockingHook = (func: Function) => (done: Function, match: Match) => {\n func({\n render: (result: any) => setContext({ ...result, match, __allowRender: true }),\n done,\n match,\n });\n };\n\n // creating the route + attaching hooks\n useEffect(() => {\n let isMounted = true;\n const router = getRouter();\n const handler = (match: false | Match) => {\n if (isMounted) {\n setContext({ match });\n }\n nextTick(() => getRouter().updatePageLinks());\n };\n // creating the route\n router.on(path, handler);\n const navigoRoute = (route.current = router.getRoute(handler));\n if (navigoRoute && name) {\n navigoRoute.name = name;\n }\n // hooking\n if (before) {\n router.addBeforeHook(navigoRoute as NavigoRoute, blockingHook(before));\n }\n if (after) {\n router.addAfterHook(navigoRoute as NavigoRoute, noneBlockingHook(after));\n }\n if (already) {\n router.addAlreadyHook(navigoRoute as NavigoRoute, noneBlockingHook(already));\n }\n if (leave) {\n router.addLeaveHook(navigoRoute as NavigoRoute, blockingHook(leave));\n }\n // adding the service leave hook\n router.addLeaveHook(navigoRoute as NavigoRoute, (done: Function) => {\n if (isMounted) {\n setContext({ match: false });\n }\n done();\n });\n // initial resolving\n router.resolve();\n // initial data-navigo set up\n router.updatePageLinks();\n return () => {\n isMounted = false;\n router.off(handler);\n };\n }, []);\n\n // make sure that the lifecycle funcs have access to the latest local state values\n useEffect(() => {\n if (before && route.current && route.current.hooks.before && route.current.hooks.before[0]) {\n // @ts-ignore\n route.current.hooks.before[0] = blockingHook(before);\n }\n if (after && route.current && route.current.hooks.after && route.current.hooks.after[0]) {\n // @ts-ignore\n route.current.hooks.after[0] = noneBlockingHook(after);\n }\n if (already && route.current && route.current.hooks.already && route.current.hooks.already[0]) {\n // @ts-ignore\n route.current.hooks.already[0] = noneBlockingHook(already);\n }\n // @ts-ignore\n if (leave && route.current && route.current.hooks.leave.length === 2) {\n // @ts-ignore\n route.current.hooks.leave[0] = blockingHook(leave);\n }\n }, [before, after, already, leave]);\n\n if (context.__allowRender) {\n return renderChild();\n } else if (switchContext.isInSwitch && context.match) {\n if (switchContext.switchMatch) {\n if (switchContext.switchMatch.route.path === context.match.route.path) {\n return renderChild();\n }\n } else {\n switchContext.switchMatch = context.match;\n return renderChild();\n }\n } else if (context.match) {\n return renderChild();\n }\n return null;\n}\nexport function Base({ path }: Path) {\n getRouter(path);\n return null;\n}\nexport function Switch({ children }: { children?: any }) {\n const [match, setMatch] = useState(false);\n useEffect(() => {\n function switchHandler(match: Match) {\n setMatch(match);\n }\n getRouter().on(\"*\", switchHandler);\n return () => {\n getRouter().off(switchHandler);\n };\n }, []);\n return (\n \n {children}\n \n );\n}\nexport function NotFound({ children, hooks }: NotFoundRouteProps) {\n const match = useNotFound(hooks);\n\n if (match) {\n return {children} ;\n }\n return null;\n}\nexport function Redirect({ path }: Path) {\n useEffect(() => {\n getRouter().navigate(path);\n }, []);\n return null;\n}\n\n// hooks\nexport function useNavigo(): NavigoRouting {\n return useContext(Context);\n}\nexport function useLocation(): Match {\n return getRouter().getCurrentLocation();\n}\n\n// internal hooks\nfunction useNotFound(hooks?: RouteHooks | undefined): false | Match {\n const [match, setMatch] = useState(false);\n const handler = useRef((match: false | Match) => {\n setMatch(match);\n nextTick(() => getRouter().updatePageLinks());\n });\n\n useEffect(() => {\n // @ts-ignore\n const router = getRouter();\n router.notFound(handler.current, hooks);\n router.addLeaveHook(\"__NOT_FOUND__\", (done: Function) => {\n setMatch(false);\n done();\n });\n router.resolve();\n router.updatePageLinks();\n return () => {\n router.off(handler.current);\n };\n }, []);\n\n return match;\n}\n\nconst API = {\n getRouter,\n configureRouter,\n reset,\n Route,\n Base,\n Switch,\n NotFound,\n Redirect,\n useNavigo,\n useLocation,\n};\n\nexport default API;\n"],"sourceRoot":""}
--------------------------------------------------------------------------------