#NextJS 13 app directory - how to get global state?

2 messages · Page 1 of 1 (latest)

main parcel
#

Hi everyone,

I am making an app that requires authentication. I am sharing the log in state on a global level with context. But context can only run on client side. Since I am wrapping the entire layout with the provider component which is client side (as I use context), does that mean every children is also working client side now?

Also how do I provide a global state to my components in app directory? Any tips?

topaz parrot
#

Not necessarily, children can be server components as long as the root component is a server component, but I dont think they ll be able to have access to context