Cache, double-fetching and error handling #5091
-
Hi everyone! I have a question regarding an over-engineered implementation I am thinking of creating. I've read through the docs and experimented with the useQuery API a bit, but it doesn't seem that what I want to do works without an ugly workaround. If anyone has any ideas, I'd appreciate your input/help. (henceforth I will be using the Posts/Post example in the useQuery examples page) My problem is that I want the following features: Example code attempting to implement the features above: I can use "placeholderData" and get features A, B, D and E. The solution I came up with to get all the features I want involves adding an attribute to the placeholder data (example: Does anyone have any better/simpler ideas? Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I would use
|
Beta Was this translation helpful? Give feedback.
I would use
placeholderData
, and then also manually show it in error state if there is no data, like: