├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ ├── size.yml │ ├── test.yaml │ └── codeql.yaml ├── docs ├── _config.docker.yml ├── .gitignore ├── api │ ├── useFullPath.md │ ├── usePath.md │ ├── useHash.md │ ├── useBasePath.md │ ├── useHistory.md │ ├── RouterProvider.md │ ├── useNavigationPrompt.md │ ├── ActiveLink.md │ ├── useRedirect.md │ ├── Redirect.md │ ├── Link.md │ ├── useNavigate.md │ ├── useMatch.md │ ├── navigate.md │ ├── useQueryParams.md │ ├── usePathParams.md │ ├── useLocationChange.md │ └── useRoutes.md ├── docker-compose.yaml ├── README.md ├── index.md ├── _config.yml ├── guides │ ├── migration_to_v5.md │ └── migration_to_v4.md └── _sass │ └── custom │ └── custom.scss ├── scripts └── start-docs ├── .gitignore ├── example ├── vite.config.ts ├── src │ ├── Nav.tsx │ ├── main.tsx │ ├── app.css │ ├── Form.tsx │ ├── NestedApp.tsx │ └── App.tsx ├── index.html ├── .gitignore ├── tsconfig.json ├── eslint.config.js └── package.json ├── src ├── typeChecks.ts ├── node.ts ├── hooks.ts ├── types.ts ├── main.ts ├── context.tsx ├── redirect.ts ├── intercept.ts ├── querystring.ts ├── Link.tsx ├── navigate.ts ├── location.ts └── router.tsx ├── CONTRIBUTING.md ├── jest.config.ts ├── eslint.config.mjs ├── LICENSE ├── test ├── utils.ts ├── context.spec.tsx ├── redirect.spec.tsx ├── querystring.spec.tsx ├── Link.spec.tsx ├── navigate.spec.tsx ├── location.spec.tsx └── router.spec.tsx ├── rollup.config.mjs ├── tsconfig.json ├── README.md ├── package.json └── CHANGELOG.md /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @kyeotic 2 | -------------------------------------------------------------------------------- /docs/_config.docker.yml: -------------------------------------------------------------------------------- 1 | url: "http://localhost:4000" -------------------------------------------------------------------------------- /scripts/start-docs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd docs && docker compose up -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .DS_Store 3 | node_modules 4 | .cache 5 | .parcel-cache 6 | dist 7 | dist_old/ 8 | build/ 9 | junit.xml 10 | coverage/ -------------------------------------------------------------------------------- /example/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vite.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /src/typeChecks.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type 2 | export function isFunction(obj: unknown): obj is Function { 3 | return !!obj && typeof obj === 'function' 4 | } 5 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Hugo default output directory 2 | /public 3 | 4 | ## OS Files 5 | # Windows 6 | Thumbs.db 7 | ehthumbs.db 8 | Desktop.ini 9 | $RECYCLE.BIN/ 10 | 11 | # OSX 12 | .DS_Store 13 | /node_modules 14 | /dist 15 | /example 16 | /_site/ -------------------------------------------------------------------------------- /example/src/Nav.tsx: -------------------------------------------------------------------------------- 1 | import React, { Children } from 'react' 2 | 3 | export default function Nav({ children }) { 4 | return ( 5 |
Path: {contextPath}
31 |BasePath: {contextBasePath}
32 |Label: "{label}"
45 |Path: "{path}"
46 |Base Path: "{basePath}"
47 |Param: "{extra}"
48 |{user.name}
72 | )))} 73 |{user.name}
39 | )))} 40 |Home
77 | 90 | 103 |Error
133 |{JSON.stringify(state)}
134 | 142 |