How to create the Typescript type from a generic?
5 Replies
It's not possible in TypeScript to dynamically create a generic name like that.
You will have to pass the param to the AT generic like you did in the other example and infer that
ah ok, good to know, so this seems working:
Is it also possible to write that shorter? Something like this? (In this case he seems not liking the function call)
No, TS doesn't let you do much directly within a typeof expression
All right - thanks a lot for your help! 🙂
Sorry about that! Good luck