mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-29 22:02:46 -07:00
feat: set zustand store server side
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
import * as React from 'react'
|
||||
import { useRouter } from '../hooks/useRouter'
|
||||
import { useRouterStore } from '../hooks/useRouterStore'
|
||||
import { RouteMatch } from './RouteMatch'
|
||||
import NotFound from './NotFound'
|
||||
|
||||
interface MatchesProps {
|
||||
serverPath?: string
|
||||
}
|
||||
|
||||
export function Matches({ serverPath }: MatchesProps): JSX.Element {
|
||||
export function Matches(): JSX.Element {
|
||||
const location = useRouterStore((st) => st.location)
|
||||
const router = useRouter()
|
||||
|
||||
const route = router.routesById[location?.pathname || serverPath || '']
|
||||
const route = router.routesById[location.pathname]
|
||||
|
||||
if (!route) {
|
||||
return <NotFound />
|
||||
|
||||
Reference in New Issue
Block a user