Response loses type when specifying type arguments manually
Hi there! Just started messing around with Hono and was trying to optimize for typesafety. The docs state that adding the path as a generic parameter can help with type inferencing
https://hono.dev/docs/guides/rpc#specify-type-arguments-manually
so I gave this a shot
But my response type from
response
is:
ClientResponse<{}, StatusCode, string>
However if I remove the generic parameter (i.e. remove the <"/:id/features">
, my response
is accurately typed
I was wondering if I was missing something? Or maybe this is not necessary since I'm creating a typed client for re-use:
I tried searching around a bit but all the examples I saw in other GH issues or discussions didn't strongly type the path like this. Thanks for any help!RPC - Hono
Web framework built on Web Standards for Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, Node.js, and others. Fast, but not only fast.
0 Replies