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

121
Views
How to display something determined by if the user is connected or not to a website

I'm looking for something that display some links (login & register) if (!userConnected) but if(userConnected) I want to display another informations than login & register.

I will display the elements by changing the states of userConnected bymyself so it doesn't have to be automatic, just functionnal if I put false to userConnected. Thanks!

I'm using React and react-router-dom in 5.2.0

<Route exact path="/"> {userConnected ? <Home/> : <Register>} </Route>

I've tried this but this is with new pages and me I want to be in the same page. So I thought to do the same home page twice and if the user is connected it will display the home page with her profile pic and if he's not login it will still display the home page but without profile pic and with the login and register links.

about 4 years ago · Juan Pablo Isaza
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!