avoiding used more hooks than previous render
I understand whats causing the error in my code, im checking if id is defined before calling useQuery as it requires it to be passed in.
How do i make sure useQuery is only called when is becomes defined, but in the same time calling it before the null check of id?
Solution:Jump to solution
Solution
pass
enabled: condition
in useQuery options
```ts
procedures.readOne.useQuery({ id: id as string }, { enabled: id !== undefined })...2 Replies