Typing nested controlled
Hi, how can I get this param typed?
I know this is not recommended https://hono.dev/docs/guides/best-practices but I have a 1000+ nested controlled that I need to refactor
Best 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.
3 Replies
I got away doing this but idk if it is correct
hey! pulling out routes (what you're calling a controller) is totally standard
when the hono docs are talking about controllers, they're referring to the logic of your route handlers
your typing solution is fine, though perhaps a little fragile. to improve the typing a smidge, you could
but i'd suggest adjusting the way you're breaking out routes, for better DX
Got it, thanks 😄