mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-29 22:02:46 -07:00
feat: handle custom not found error
This commit is contained in:
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user