Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Fix problematic fetchMore notifyOnNetworkStatusChange renders #3433

Merged
merged 1 commit into from Aug 30, 2019

Conversation

hwillson
Copy link
Member

Prior to this PR, when notifyOnNetworkStatusChange is true calls to fetchMore do not wait for updateQuery to finish, before triggering a re-render. This means that after a fetchMore call, components will flip to loading: true, then loading: false, then un-necessarily re-render once more as loading: false with the result from updateQuery. This commit adds a check to see if fetchMore has been called and then holds off on re-rendering the loading: false state, until updateQuery has fully finished.

Fixes #3333

Prior to this commit, when `notifyOnNetworkStatusChange` is true
calls to `fetchMore` do not wait for `updateQuery` to finish,
before triggering a re-render. This means that after a `fetchMore`
call, components will flip to `loading: true`, then
`loading: false`,  then un-necessarily re-render once more as
`loading: false` with the result from `updateQuery`. This commit
adds a check to see if `fetchMore` has been called and then holds
off on re-rendering the `loading: false` state, until `updateQuery`
has fully finished.

Fixes #3333
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Hooks] fetchMore option updateQuery triggers hook update but with previous data
1 participant