Skip to content

Commit

Permalink
feat: using axios.request to pass TS types
Browse files Browse the repository at this point in the history
  • Loading branch information
danestves committed Oct 13, 2021
1 parent 57a89b9 commit 9f21a61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/axios-typescript/libs/useRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function useRequest<Data = unknown, Error = unknown>(
* function is actually only called by `useSWR` when it isn't.
*/
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
() => axios(request!),
() => axios.request<Data>(request!),
{
...config,
fallbackData: fallbackData && {
Expand Down

0 comments on commit 9f21a61

Please sign in to comment.