Can not get the Types in route fn
Hi,
I am trying to learn this framework.
But I am having some difficulty here, and I think you can help me.
This way I can get the Types from the valid() fn.
But like this I can't, why?
2 Replies
This isn't a hono or framework thing, this is a typescript thing
You've declared an async function that takes one argument
c
, without a type declaration, so correct typescript has no idea what c.req.valid("query")
is as it doesn't even know what c
isBest Practices - Hono
Web framework built on Web Standards for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.