Next.js Discord

Discord Forum

May I chain server component, into client component, into server component, into client component ?

Unanswered
Podenco Canario posted this in #help-forum
Open in Discord
Podenco CanarioOP
Hello,

My structure is actually like this :

1. layout.tsx (server by default)
2. Context Provider ('use client' because I need a useEffect)
3. page.tsx ('use server' if needed, mostly to handle dynamic data like page title)
4. PageName.tsx ('use client' component to render all the rest of my app)

From my understanding "page.tsx" in this context (pun not intended) is considered a server action.
For context (pun still not intended) the ContextProvider is used to get data from a Third Party library (Supabase) to have a way to access everything in client component easily

Am I crazy doing this ?

0 Replies