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

167
Views
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 answers
Answer question

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 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!