forked from axios/axios
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the default type of response data never (axios#3002)
This requires TypeScript users to explicitly define the type of the data they are consuming. Before this, data was `any` by default. This means TypeScript consumers didn’t get type safety if they forgot to specify the type. Technically this is a breaking change for TypeScript users, as this will report errors if they forgot to specifiy the response type. The simplest workaround would be to explicitly set the response type to `any`, so it’s not breaking much. The `unknown` type is probably a slightly better fit, but this requires TypeScript ^3. `data` is still `any` in the very specific use case mentioned in microsoft/TypeScript#38969 Co-authored-by: Jay <jasonsaayman@gmail.com>
- Loading branch information
1 parent
a362fef
commit cdec809
Showing
2 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters