#How to share data between pages
5 messages · Page 1 of 1 (latest)
I believe that what you'll need to do is fetch your data and store it in state which is then accessed by both pages.
https://indepth.dev/posts/1487/deep-dive-into-state-management-with-react-and-nextjs is a good article that outlines different approaches.
you can leverage useQuery. The lib caches the https response and get the data from the cache from any page. if you need an example let me know.
also you can create React context and wrap in _app.tsx here you can share state between pages.
you can try https://tanstack.com/query/v4 so you dont have to be bothered with multiple api calls