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

230
Views
¿Cómo convertir algunas palabras de una oración en un enlace?

Este es un ejemplo de cómo crear enlaces en una cadena usando reaccionar. La mayoría de los ejemplos que encontré eran mi dominación manipuladora, así que después de tanto jugar, descubrí cómo hacerlo.

 function profile() { const hashtagRegex = /\B(\#[a-zA-Z]+\b)(?!;)/gm; const { fullName, userName, image, bio } = userProfileData; const bioMatch = bio && bio.match(hashtagRegex); const editbio = bio && bio.split(" "); bioMatch && editbio.map((word, index) => { if (word.match(hashtagRegex)) { editbio[index - 1] = editbio[index - 1] + " "; editbio[index] = <a href="https://google.com">{word}</a>; } else { editbio[index] = " " + word; } }); return ( <div className="profile">{editbio}</div> ); }

Si agrega espaciado directamente al índice de matriz, convierte el enlace en [object][object] y si intenta unirse al retorno, hace lo mismo, así que funcionó para mí. Si alguien tiene una mejor manera de hacerlo, por favor comparta.

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

0

La forma más fácil de vincular el sitio web al texto si está tratando de hacerlo con HTML sería

 <p><a href="link">word</a></p>
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!