You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click the button. It changes the url, but the data returned is always the same, since it's a static function.
Component remains in loading state, instead of displaying the new url.
See also the incrementing counter in the console for the new url, indicating that useSWR keeps re-fetching the data.
Kapture.2021-03-29.at.14.56.04.mp4
You can toggle lines 29 and 34 and see that a different API response triggers a render, whereas the same response remains in loading.
You can toggle line 22 and see that without suspense things work fine, but as soon as suspense is on, it keeps loading forever when the response is the same.
Additional Context
I was under the impression that this worked before v0.5 but changing the version on CodeSanbox yields the same result, so I'm not so sure anymore
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
When using suspense mode, if two API calls with different urls return the same data, the component remains in a loading state.
Expected Behavior
The component should update to reflect the new data, even if it's identical to the previous data.
Repro Steps / Code Example
https://codesandbox.io/s/recursing-williams-lsh4m?file=/pages/index.js
Click the button. It changes the url, but the data returned is always the same, since it's a static function.
Component remains in loading state, instead of displaying the new url.
See also the incrementing counter in the console for the new url, indicating that
useSWR
keeps re-fetching the data.Kapture.2021-03-29.at.14.56.04.mp4
You can toggle lines 29 and 34 and see that a different API response triggers a render, whereas the same response remains in loading.
You can toggle line 22 and see that without suspense things work fine, but as soon as suspense is on, it keeps loading forever when the response is the same.
Additional Context
I was under the impression that this worked before v0.5 but changing the version on CodeSanbox yields the same result, so I'm not so sure anymore
The text was updated successfully, but these errors were encountered: