Prevent data re-fetch on component re-render
mshumayl opened this issue · comments
This can be done by moving all data fetches into a useEffect
with an empty dependency array.
There may be nothing wrong with the useEffect
s after all. This is actually due to a react-query behaviour (via tRPC):
https://stackoverflow.com/questions/70337333/react-query-refetch-on-window-focus-but-not-otherwise