ReactType
Description
Types a page component so its props are exactly the matching Rust handler's return type, keyed by the route path.
Signature
tsx
type OssidoPage<Path extends keyof RouteProps> = (props: RouteProps[Path]) => ReactNode
Examples
tsx
import type { OssidoPage } from '@ossido-labs/ossido/types';
const Home: OssidoPage<'/'> = ({ message }) => <h1>{message}</h1>;
export default Home;