Next.js Discord

Discord Forum

Navigating from client component to server component

Answered
Dovekie posted this in #help-forum
Open in Discord
DovekieOP
I'm rendering a table and I want to make it so when a user clicks on a row it gets navigated to /campaigns/{campaignIdOfRow}

The table is ofc a client component and the /campaigns/{campaignIdOfRow} a server component.

I've tried using <Link/> or router.push() from next/navigation but they won't perform the navigation.

What is the proper way to do this ?
Answered by riský
can you show an example of code that doesn't work (as it works well for me)
View full answer

4 Replies

I would think both Link and router push should work. Those are the proper ways.
Answer
DovekieOP
Oh this was my bad guys, I just realised that I had a dumb little mistake in my code. Thanks for the replies!
yaya, it works 🎉