mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
refactor: replace () => JSX.Element with React.ComponentType (#120)
This commit is contained in:
committed by
GitHub
parent
957d08701f
commit
55490579ec
@@ -3,7 +3,11 @@ import { AppShell } from '@mantine/core'
|
||||
|
||||
import SidebarLink from './sidebar-link'
|
||||
|
||||
export default function Sidebar({ close }: { close: () => void }): JSX.Element {
|
||||
interface SidebarProps {
|
||||
close: () => void
|
||||
}
|
||||
|
||||
export default function Sidebar({ close }: SidebarProps): JSX.Element {
|
||||
return (
|
||||
<AppShell.Navbar p="md">
|
||||
<SidebarLink
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { JSX } from 'react'
|
||||
import type { ComponentType as ReactComponentType } from 'react'
|
||||
|
||||
import { trimPath, trimPathRight } from './utils'
|
||||
import type { Route } from './route'
|
||||
@@ -12,7 +12,7 @@ interface CreateRouter {
|
||||
}
|
||||
|
||||
interface RouteOptions {
|
||||
component?: () => JSX.Element
|
||||
component?: ReactComponentType
|
||||
hasHandler?: boolean
|
||||
routeTree?: RouteTree
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ComponentType as ReactComponentType } from 'react'
|
||||
|
||||
export interface Segment {
|
||||
type: 'pathname' | 'param' | 'wildcard'
|
||||
value: string
|
||||
@@ -17,6 +19,6 @@ export interface RouteProps {
|
||||
isLoading: boolean
|
||||
}
|
||||
|
||||
export type RouteComponent = ((props: RouteProps) => JSX.Element) & {
|
||||
export type RouteComponent = ReactComponentType<RouteProps> & {
|
||||
preload: () => void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user