Replies: 1 comment
-
Yes, I’d expect that too. Can you create a minimal reproduction with stackblitz please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @TkDodo ! :)
Not sure if this is a bug or just something that i completely misunderstand 😅
We have various screens in our React Native app that load data from an API and use polling (
refetchInterval) to keep this data up to date. We've seen some odd things so i'm debugging what is happening exactly when error occur. I'm using this code to debug:This refetches every 5 seconds. Then for the 4th and 5th refetch it rejects with an error.
I expect that the user always see the succesfully fetched data. This is described in the docs:
You also mention it here: #8985 (comment)
And i totally agree with your statement; you want to show the (old) data, not the error.
What i'm seeing is that the data is loaded and shown normally. Polling works 👍
Then when
c%4 === 0triggers i see the error is "hidden" and the existing data stays on the screen. All good!But with the next refetch things start "misbehaving":
The spinner is shown...
Then when i enable
c%4 === 1(so 2 consecutive errors) the error is thrown to the boundary...I made a short movie that shows how the above code behaves:
https://github.com/user-attachments/assets/25a39ee5-1c0e-4d20-9ce5-d02091b8d289
I would expect, after reading the docs and your comments, that any existing data is always shown when refetching/polling fails.
Is this expectation correct? Is there a bug? What causes this behaviour?
Beta Was this translation helpful? Give feedback.
All reactions