Next.js Discord

Discord Forum

Context variable and streaming - best practice?

Unanswered
Valentine ant posted this in #help-forum
Open in Discord
Valentine antOP
Hello, I have some user settings (read from the database), saved in context variables, for example what is the focused period - month or week, which affects the user layout and the data that should be shown in that layout. I would like to stream the data for that period with suspense but this mixes client and server components. Should I make s client wrapper which gets the context vars, and sends them as props to the server components children? (Pattern Passing Server Components to Client Components as Props) or there is another approach?

0 Replies