feat(packages/tuono): improve TuonoRouteProps type (#648)

This commit is contained in:
Marco Pasqualetti
2025-03-18 09:07:38 +01:00
committed by GitHub
parent 2301083edc
commit d562aa87a3
8 changed files with 59 additions and 15 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import type { JSX } from 'react'
import type { TuonoProps } from 'tuono'
import type { TuonoRouteProps } from 'tuono'
import { Link } from 'tuono'
interface IndexProps {
@@ -9,7 +9,7 @@ interface IndexProps {
export default function IndexPage({
data,
isLoading,
}: TuonoProps<IndexProps>): JSX.Element {
}: TuonoRouteProps<IndexProps>): JSX.Element {
if (isLoading) {
return <h1>Loading...</h1>
}
@@ -17,8 +17,8 @@ export default function IndexPage({
return (
<>
<h1>TUONO</h1>
<h2>{data?.subtitle}</h2>
<Link href={'/second-route'}>Routing link</Link>)
<h2>{data.subtitle}</h2>
<Link href={'/second-route'}>Routing link</Link>
</>
)
}