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

202
Views
cómo usar esta función de mapa en React para llamar a la URL con el nombre de las imágenes
 socialLinks: { instagram: 'https://twitter.com/xyz', facebook: 'https://facebook.com/xyz', linkedin: '#', },

cómo crear un bucle para que el resultado sea así:

 <div> <a href="https://instagram.com/xyz"> <image src="instagram.png" /> </a> <a href="https://facebook.com/xyz"> <image src="facebook.png" /> </a> <div>

Nota: si no hay un enlace de Linkedin, no aparecerá ningún enlace ni imagen.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Puede aprovechar Object.entries :

 <div> { Object.entries(socialLinks).filter(([k,v]) => v.startsWith("https:")).map(([k,v]) => <a key={v} href={v}> <image src={`${k}.png`} /> </a> ) } </div>
about 4 years ago · Juan Pablo Isaza Report

0

const SocialMedia = () => { let socialLink = { instagram: 'https://twitter.com/xyz', facebook: 'https://facebook.com/xyz', twitter: 'https://twitter.com/xyz' } return ( <div> { Object.keys(socialLink).map((key, index) => { return ( <a href={socialLink[key]} key={index}> <image src={key+'.png'} /> </a> ) }) } </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!