Best Approach for Form
I have this text input on a page where a user is supposed to put an ID and therefore the submission of that ID should trigger fetching and rendering of the results.
What im having issues is when the page is initially loaded there is no ID defined yet. So my question is whats the best approach for executing a useQuery until after this form is submitted?
1 Reply
harsh-harlequin•3y ago
Disabling/Pausing Queries | TanStack Query Docs
If you ever want to disable a query from automatically running, you can use the enabled = false option.
When enabled is false: