import { hc } from 'hono/client' import { useState } from 'react' import useSWRMutation from 'swr/mutation' import { AppType } from './api/[...route]' const client = hc('/') const postHello = async (_: string, { arg }: { arg: string }) => { const res = await client.api.hello.$post({ form: { name: arg } }) return await res.json() } export default function Home() { const { trigger, isMutating, data } = useSWRMutation('post-hello', postHello) const [name, setName] = useState('') return (
setName(e.target.value)} placeholder="Name" />

{data?.message}

) }