import React from "https://esm.sh/react";import { Container } from "../container.ts";import { Request } from "../mod.ts";
export const options = { template: "react.template.html", title: "React SSR",};
export const props = async function (request: Request) { const container: Container = request.container; return { params: request.getParams(), header: "Click me!", repository: await container.repository, };};
const App = (props: { params: string[]; header: string }) => { const [count, setCount] = React.useState(0); return ( <div> <h2>{props.header}</h2> <p> This page was created using Deno, Fastro and React's server-side rendering (SSR). Click to try the react hook. </p> <button onClick={() => setCount(count + 1)}>Click me</button> <p>You clicked me {count} times</p> </div> );};
export default App;