Next.js Discord

Discord Forum

Routing or Conditional Rendering?

Unanswered
Balinese posted this in #help-forum
Open in Discord
BalineseOP
Hello I have a Dashboard that has different views based on what section (a component) title you click on the header
# What is a better practice:
- Make a page for each section? So when you click on the header, it routes you to another page
- Or Having a state variable at the header then pass it to the parent page.tsx and then render a different section (component) each time you click one on the header?
# My page component for now
export default function studentDashboard() {
  return (
    <main>
      <Header/>
      <Module/>
      <Footer/>
    </main>
  );
}

# Example of my different dashboard pages
(Doesn't look like a dashboard ik 😅 )

0 Replies