#How to share data between pages

5 messages · Page 1 of 1 (latest)

gaunt wind
#

Hi, I'm pretty new to next js
I'm currently fetching data from client side for a page, now part of this data is useful for my dynamic route.
how can i share this data between the two pages. consider the api is conservative and would like to avoid the api call inside the dynamic route to get the same data.
thanks!

median vault
zealous crest
#

also you can create React context and wrap in _app.tsx here you can share state between pages.

green garden