Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/izumisy/react-nanorouter
Terribly simple router for React
https://github.com/izumisy/react-nanorouter
react router
Last synced: 6 days ago
JSON representation
Terribly simple router for React
- Host: GitHub
- URL: https://github.com/izumisy/react-nanorouter
- Owner: IzumiSy
- License: mit
- Created: 2020-05-10T10:27:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T22:05:47.000Z (over 1 year ago)
- Last Synced: 2024-04-20T01:22:02.603Z (7 months ago)
- Topics: react, router
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@izumisy/react-nanorouter
- Size: 601 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# react-nanorouter
[![react-nanorouter](https://circleci.com/gh/IzumiSy/react-nanorouter.svg?style=svg)](https://app.circleci.com/pipelines/github/IzumiSy/react-nanorouter)
[![npm version](https://badge.fury.io/js/%40izumisy%2Freact-nanorouter.svg)](https://www.npmjs.com/package/@izumisy/react-nanorouter)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)Terribly simple router for React
## Example
Only `useRouter` function is available.
```javascript
import { useRouter } from 'react-nanorouter'
import { ProductsPage } from './pages/products'
import { UsersPage } from './pages/users'function App() {
const [history, router] = useRouter({
'/products': (history) => ,
'/users': (history) => ,
})return (
<>{router}>
)
}
```## Contributions
PRs accepted## LICENSE
MIT