How to type return of hook based on string passed as argument?
I wanna have different types based on string passed as the argument of a custom hook, but i don't know how to infer types of zod schema dynamically based on a received string. I reckon typescript helpers function might help but i don't know any.
3 Replies
From chatgpt, not tested!
It worked man, thx, did you use Chat GPT 4?
Nope just 3.5