Next.js Discord

Discord Forum

How to render a server component, depending on the client component ?

Unanswered
Nile Crocodile posted this in #help-forum
Open in Discord
Nile CrocodileOP
So, I am learning next 13 while building a personal blog. one the writings page, there are two components, one is nav (client), that contains name of lists of my articles, another is the article (server). Depending on the what item in nav component was clicked, I want to render the article. How to do it ?

The blogs are stored in the local directory of the project itself, named blog and I have written utility functions to fetch and work with that data, it is a single place where I push my articles (markdown) -> triggers a build through vercel and renders the new article on my website.

The parent component is the page itself, which is server, inside of it, the nav component is client and Article component is server. How do I make this work ?

I have attached a photo of the expected layout.

0 Replies