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
Drakenhielm2y ago
I'm not sure I understand can you share your react code?
Abhishek
Abhishek2y ago
@burnstony#1975 could you share the react snippet to understand your problem
Michal Srb
Michal Srb2y ago
You shouldn't need useEffect. If the ID isn't changing the query won't run multiple times.
burnstony#1975
burnstony#1975OP2y ago
OK, I'll have to rethink what I am doing - Thank you

Did you find this page helpful?