# router-mini

> common mini router for web app

Latest version **0.1.1** (published 2023-05-27) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install router-mini
pnpm add router-mini
yarn add router-mini
bun add router-mini
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-05-27 |
| First published | 2023-05-15 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 肥肥狗蛋的粑粑妈妈和她大爷 |
| Maintainers | dggy |

## Links

- npm: https://www.npmjs.com/package/router-mini
- Repository: https://github.com/learnfor11/react
- Homepage: https://github.com/learnfor11/react#readme
- Issues: https://github.com/learnfor11/react/issues
- npm.io page: https://npm.io/package/router-mini

## Dependencies (1)

- [@ppzp/utils.rc](https://npm.io/package/@ppzp/utils.rc.md) >=0.0.10

## Recent versions

- 0.1.1 (latest) — 2023-05-27
- 0.1.0 — 2023-05-27
- 0.0.3 — 2023-05-15
- 0.0.2 — 2023-05-15
- 0.0.1 — 2023-05-15
- 0.0.0 — 2023-05-15

## README

# Router mini

##### 安装
``` bash
npm install router-mini
```

## React
``` jsx
import { Router, Link, useRoute } from 'router-mini/react.js'

export default function App() {
  return <Router
    routes = {[
      { path: '/', element: <Home /> },
      { path: '/a', element: <PageA /> },
      { path: '/b', element: <PageB /> },
      { path: '/c', element: <PageC /> }
    ]}
  />
}

function Home() {
  return <div>
    <Link to="/a">a</Link>
    <Link to="/b">b</Link>
    <Link to="/c">c</Link>
  </div>
}

function PageA() {
  return <div>page a</div>
}
function PageB() {
  return <div>page b</div>
}
function PageC() {
  const route = useRoute().value
  console.log({ route }) // "/c"
  return <div>page c</div>
}
```

## License
the Unlicense

---
_Source: https://npm.io/package/router-mini · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
