3 ms·
If you can't understand the benefits of using RTK Query over fetch I'm not sure you're credible. They're not even substitutes; RTK Query by default wraps fetch
by nosefurhairdo 3y ago
If you can't understand the benefits of using RTK Query over fetch I'm not sure you're credible.
They're not even substitutes; RTK Query by default wraps fetch or can be configured to use your preferred http client. So it's an entirely additional layer of cacheing and refetching logic with a standardized interface around common loading and error states.
It is considerably easier to write performant web applications with a library like RTK Query or TanStack Query than to just use fetch and try to roll your own cacheing solution. I say this as someone who has done all of the above professionally.