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
If the url changes in useLoadedData, then sync is called again, triggering another fetch. If another fetch was already in progress, and finishes after this new fetch, then it will overwrite the new (expected) result.
This hook is used a lot. Replacing uses with @tanstack/react-query's useQuery should resolve the issue, as well as bring multiple advantages, such as automatic data caching.
For a concrete example, see https://www.worldcubeassociation.org/teams-committees-councils. If you click on several different teams in quick succession, multiple fetches will trigger, and whichever happens to finish last will decide what data is shown in the table (title, description, and contact info is fetched separately, and will be correct).
The text was updated successfully, but these errors were encountered:
I think we have an issue to replace all usages of useLoadedData. I think the easier solution would be to use it as a wrapper for useQuery and then replace the usages.
Describe the bug
If the
url
changes inuseLoadedData
, thensync
is called again, triggering another fetch. If another fetch was already in progress, and finishes after this new fetch, then it will overwrite the new (expected) result.This hook is used a lot. Replacing uses with
@tanstack/react-query
'suseQuery
should resolve the issue, as well as bring multiple advantages, such as automatic data caching.Probably the cause of #8760 too.
To Reproduce
For a concrete example, see https://www.worldcubeassociation.org/teams-committees-councils. If you click on several different teams in quick succession, multiple fetches will trigger, and whichever happens to finish last will decide what data is shown in the table (title, description, and contact info is fetched separately, and will be correct).
The text was updated successfully, but these errors were encountered: