https://github.com/lsongdev/fre-routes
📍 simple routes for fre
https://github.com/lsongdev/fre-routes
fre fre-routes
Last synced: 8 months ago
JSON representation
📍 simple routes for fre
- Host: GitHub
- URL: https://github.com/lsongdev/fre-routes
- Owner: lsongdev
- License: mit
- Created: 2019-10-24T12:12:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-24T12:20:31.000Z (over 6 years ago)
- Last Synced: 2025-02-13T22:23:40.987Z (over 1 year ago)
- Topics: fre, fre-routes
- Language: JavaScript
- Homepage: https://npmjs.org/fre-routes
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## fre-routes
> simple routes for fre
[](https://npmjs.org/fre-routes)
### Installation
```bash
$ npm install fre-routes
```
### Example
```js
import { h, render } from 'fre'
import { useRoutes, push } from 'fre-routes';
const routes = {
'/': () => (
home
push('/home/jack')}>Go jack
),
'/home/:id': ({ id }) => (
{id}
push('/')}>Go home
),
}
const App = () => useRoutes(routes)
render(, document.getElementById('root'))
```
### Contributing
- Fork this Repo first
- Clone your Repo
- Install dependencies by `$ npm install`
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3
### MIT
This work is licensed under the [MIT license](./LICENSE).
---