feat: handle custom not found error

This commit is contained in:
Valerio Ageno
2024-05-11 16:08:51 +02:00
parent ef98cfed90
commit 90de047a07
3 changed files with 39 additions and 5 deletions
@@ -1,6 +1,7 @@
import * as React from 'react'
import { useRouter } from '../hooks/useRouter'
import { useRouterStore } from '../hooks/useRouterStore'
import NotFound from './NotFound'
export function Matches(): JSX.Element | undefined {
const matchId = useRouterStore.getState().matches[0]?.id
@@ -26,6 +27,10 @@ const Match = React.memo(function ({ id }: MatchProps) {
const route = router.routesById[location?.pathname]
if (!route) {
return <NotFound />
}
if (route.options.hasHandler) {
console.log('Has rust handler')
}