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

Did you find this page helpful?