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

166
Vistas
how to change a list according to screen size(less than 500px)

my user is showing 4 educational titles. I want it to only show 1 on mobile screen(less than 500px); How can I Accomplish this in react? below is the code and how it looks on a normal wide screen resolution and how Id like it to look

return (
        <div className="educations-section">
            {user.educations.map(
                (educationRecord) => (
                    <div key={educationRecord._id}>{educationRecord.degree}</div>
                )
            )}
        </div>
    )

enter image description here enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

use some conditioned rendering

let show1 = window.innerWidth <= 500;
return (
        <div className="educations-section">
            { Show1 && <div key={user.educations[0]._id}>{user.educations[0].degree}</div>}
            { !Show1 && user.educations.map(
                (educationRecord) => (
                    <div key={educationRecord._id}>{educationRecord.degree}</div>
                )
            )}
        </div>
    )
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