Post
But honestly, I think this is a bad pattern anyway. Loading data in a React component that will render it is bad for the end user because you have to show them a loading state. It's more buttery smooth to find clever moments to prefetch and only use React once you have the data you need.
0 reposts1 like
I think at that point we've gone back to the "data fetching logic is full of edge cases and you shouldn't write that code yourself, especially when there's libs that do the hard work correctly" case: tkdodo.eu/blog/why-you...
tkdodo.euWhy You Want React QueryLet's take a look at why you'd want a library like React Query, even if you don't need all the extra features it provides...