fre-router
v0.0.0
Published
A router hook for react and fre
Downloads
6
Readme
fre-router
A router hook for react and fre
Use
import { createRouter, useRouter, push } from 'fre-router'
createRouter([
{
path: '/home',
component: () => <>
<button onClick={() => push('/home/yse')}>Go yse</button>
</>,
children: [
{
path: '/:username',
component: params => <>
<p>{params.username}</p>
<button onClick={() => push('/home')}>Go home</button>
</>
}
]
}
])
export const App = () => useRoute('/home')