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

95
Views
Conditionally rendering in React.js not working

I am making a website with a Navbar component at the very top of the site, I only want the Navbar to be there when the width of the window is > 900 pixels. I have tried how I usually conditionally render but it's not working, the navbar is always visible.

Here is my code

{window.screen.width > 900 && (
   <Navbar />
)}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you should trigger window screen width changes like:

window.addEventListener('resize', handleResize)
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!