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

164
Views
how to change is background color of selected item in list in react js

only selected item have change the background color of list, please help to how to change the background color of specific element in this list items

 <div style={{ padding: '0px 28px', marginBottom: '20px' }}>
               <div className='date__container'>
                  {arrdays.map((dayy, id) => (
                     <TimeContainer
                        day={dayy.day}
                        date={dayy.date}
                       
                     />
                  ))}
               </div>
            </div>

TimeContainer component

const TimeContainer = (props) => {
      const month = ['January','February','March','April','May','June','July','August','September','October','November','December'];

      
      return (
         <div
            className='dateBox'
           
            style={{
               backgroundColor: `${props.isSelected===props.key ? 'purple' : 'white'}`,
            }}
         >
            <p style={{ fontSize: '16px', color: '#888', fontWeight: 'bold' }}>
               {props.day}
            </p>
            <p style={{ color: 'black', fontSize: '17px', fontWeight: 'bold' }}>
               {props.date}
            </p>
         </div>
      );
   };
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!