Loading...
save question

How do I properly type a generic API response handler in TypeScript?

clock icon

asked 2 months ago

message icon

0

eye icon

32

I'm building a generic function to handle API responses but I'm struggling with the TypeScript types. The error says 'Type Promise<any> is not assignable to type T'.

0 Answers

Empty State Illustration

No Answers Found

The answer board is empty. Maybe it’s waiting for your brilliant answer to get things rolling!

1

Write your answer here

Provide a detailed answer to help solve the question.

Top Questions