#How to send setState functions from Root layout down to client components
8 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
it is better to use context, redux or zustand for that
Ok just to confirm, I can't do it without context/redux or some other library?
you can't do it on root layout because root layout cannot be client component. so you can't do it without global state
What do you mean by root layout cannot be client component without global state?
I can make the root layout a client component
well the doc said root layout cannot be client component before but I couldn't find it now, maybe updated
Thanks anyways, I'm gonna try use context