How to use msw with typescript? #1920
-
Last time I used Today I started a new project and noticed the api changed to Take the code from the docs for example,
What if the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
any of these work in typescript. There are many other options too, so it's hard to answer that directly since there's multiple solutions to the same problems in the type system. Generally, I'd suggest providing a few generics as you can manually and letting the type inference work, and only add them when necessary |
Beta Was this translation helpful? Give feedback.
-
Hi, @Toshinaki. This is a great question! Please refer to the Using with TypeScript best practice page from now on. You can find examples on how to annotate path params, request and response bodies in this section. |
Beta Was this translation helpful? Give feedback.
Hi, @Toshinaki. This is a great question!
Please refer to the Using with TypeScript best practice page from now on. You can find examples on how to annotate path params, request and response bodies in this section.