TanStackT
TanStack2y ago
1 reply
spotty-amber

Avoid firing useQuery on every render

Hi! So I have a useQuery for getting a list of items and let's say this list is then put into a checklist. Now my problems is, every time I change a checkbox state, the page rerenders and it fires the useQuery again.

How would I go about limiting the useQuery here? Thank you!

Note: Not sure if makes a difference, but I'm using Tanstack Table and the checkbox is to select the row.
Was this page helpful?