Next.js Discord

Discord Forum

How to load data into global state before loading page?

Unanswered
Standard Chinchilla posted this in #help-forum
Open in Discord
Standard ChinchillaOP
How do I make an API request and store its results in a global state with zumstand before I load the page and its components?

Since the component being built depends on the state (e.g. checking if the user is logged in and then building either a guest or logged page).

Currently, I am using the Nextjs 13

0 Replies