mshumayl / ai-daleel

AI Daleel source code.

Home Page:https://ai-daleel.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 useEffects 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