use-router
Hooks to work with routes in the browser
Module
import {
useRouter,
useRoute,
useRouteMatch,
useRedirect,
redirect,
getPath
} from "@atomico/hooks/use-router";useRouter syntax
const [ view, path, params, search ] = useRouter({
"/":()=><h1>home</h1>,
"user/{id}":({ id })=><my-user id={id}/>,
})useRoute syntax
useRouteMatch syntax
Last updated
Was this helpful?
