This repository was archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
onComplete being called on every render #2522
Comments
same problem. |
Does anyone know the propper way to only setState after server call? Thanks. |
This is happening to me as well. This seems to be functioning differently from what I understand the intended behavior of Any hints as to why this is happening? |
you can add an if else condition in completed function in order to prevent what will change state again and again. <Query
query={XXXXX}
onCompleted={(data) => {
if (!initValue) {
...do something
}
}}
> |
This has been fixed in current day versions of |
That's great! @hwillson Thank you for updating this ticket! |
still happening actually... |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The changes made related to issue #2177 causes
onCompleted
to be called on every render. Before it was called once.That might break the app causing a
Maximum update depth exceeded error
if trying to setSate with the data provided.The text was updated successfully, but these errors were encountered: