Next.js dynamic route param typesafety
Is there a better solution than this? Feels annoying to do this for every dynamic route.
2 Replies
I was wondering the same. I had to implement something similar and it sucks.
useRouter
query is just not coolidk if this is a good idea, but could u potetially
as string
the query if you "know" its always going to be a single thing
you can always put this into a hook as well that you pass the query param you want and make it reusable
idk the anatomy of react hooks too much but i have worked with vue composables to do something very similar
which are similar