State Management · Senior · Question 32 of 75

What is transformResponse used for in an RTK Query endpoint?

Explanation

transformResponse: (res) => res.data.items keeps the API quirks out of components and the cache. For normalized caches you can combine it with createEntityAdapter.

Further reading

Problem with a question

State Management · Senior · question 32

Test yourself

Take the State Management · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz