3 ms·
You're right, but I haven't touched a React project in ages that wasn't using a fetch library of some kind that give you hooks. Cause you're inevitably gonna w
by ervine 3y ago
You're right, but I haven't touched a React project in ages that wasn't using a fetch library of some kind that give you hooks.
Cause you're inevitably gonna want to track loading state, error state, refetch on error, revalidate etc etc.
swr or tanstack-query are great and remove the need for useEffects for API requests. For sure they come with their own overhead, but there isn't getting away from the complexity of handling API requests and all the possible paths that can happen.