Next.js Discord

Discord Forum

Which type of navigation to use ?

Unanswered
Dogo Argentino posted this in #help-forum
Open in Discord
Dogo ArgentinoOP
Hi
I have a Landing page for my website and a button to go to dashboard

as my main page , and dashboard page are server components

What way can I use to navigate to dashboard page?
what to prefer when?
1. <Link> Tag with button inside
2. useRouter push method ( need to make the page client component)
3. redirect function

5 Replies

@Dogo Argentino Hi I have a Landing page for my website and a button to go to dashboard as my main page , and dashboard page are server components What way can I use to navigate to dashboard page? what to prefer when? 1. <Link> Tag with button inside 2. useRouter push method ( need to make the page client component) 3. redirect function
That depends on your use case. I use these functions for example as follows (just examples):
1. When I want to redirect the user to a specific path without any client component
2. When I am already in a client component and want to redirect the client inside a function
3. When the user visits some route, I redirect him to the correct location
Netherland Dwarf
Also if your concern about SEO then use Link if no external logic is needed
@Netherland Dwarf Also if your concern about SEO then use Link if no external logic is needed
Dogo ArgentinoOP
all i have to do is
click on something on landing page and move to dashboard where all the content is