Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
ReactJS Prevent Navbar from rendering on certain components

I'm trying to create a web app. The app has a Home page, About, FAQ & Grow page. The Navbar will render on the pages above. I do not want it to render on my authentication pages - Login & Register Here is my Index.js:

ReactDOM.render(
  <>
    <Router>
      <App />
      <Route exact path="/register" component={Register} />
    </Router>
  </>,
  document.getElementById("root")
);

); Here is my App.js:

function App() {
  return (
    <>
      <Nav />
      <Route exact path="/" component={Home} />
      <Route exact path="/about" component={About} />
      <Route exact path="/faq" component={FAQs} />
    </>
  );
}

export default App;

How do I render the Nav component on the home page, about and FAQ page and not on my Authentication pages

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The easiest and viable option is to include the Nav on each of the components that needs it. i.e. Put it inside Home, about and faq pages respectively.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!