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

Did you find this page helpful?