nextjs fetch into a global state
i am fetching a random word i whould like to use in my entire app.
the fetching is happening on the initial get request for the URL (it is a hangman game).
i am using Jotai for over things in this game app (got sudku going on and wanna add few more games).
i am open to use context api as well, is there a way to store the random word into a global state and ship it to the client immidiatly? or should i just prop drill the random word into the client components?
1 Reply
You can fetch it in the root layout and then pass it to your state manager