Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

97
Vistas
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 Respuestas
Responde la pregunta

0

you should trigger window screen width changes like:

window.addEventListener('resize', handleResize)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda