Should queryFn(fetcher) be independent of React life cycle?
I'm working on a Next.js 14 project (App Router) and need to set up a centralized axios instance as queryFn(fetcher) in order to use react-query, which should integrates seamlessly with:
1. useSession from next-auth
2. i18n from next-intl:
3. router from next/router
4. A React modal component
I have come up with two approaches:
1. A function returned from a custom React hook
2. A standalone, React-independent function
What do you guys think? What's the right way to go about it?
1. useSession from next-auth
2. i18n from next-intl:
3. router from next/router
4. A React modal component
I have come up with two approaches:
1. A function returned from a custom React hook
2. A standalone, React-independent function
What do you guys think? What's the right way to go about it?