burnstony#1975
burnstony#19757mo ago

query inside a useEffect

I have a query that is dependent on an id. A useEffect. The useEffect runs when the id changes. However it completes before the query completes. How can I wait for the query to update once. I don’t want to run it everytime the query updates
4 Replies
Drakenhielm
Drakenhielm7mo ago
I'm not sure I understand can you share your react code?
Abhishek
Abhishek7mo ago
@burnstony#1975 could you share the react snippet to understand your problem
Michal Srb
Michal Srb7mo ago
You shouldn't need useEffect. If the ID isn't changing the query won't run multiple times.
burnstony#1975
burnstony#1975OP7mo ago
OK, I'll have to rethink what I am doing - Thank you

Did you find this page helpful?