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

217
Views
Correct React syntax for using dynamic href mailto: and tel: links

Im trying to figure out the correct syntax for using both dynamic mailto: link as well as a tel: link in a React project I'm working on. I believe I've got the 'mailto:' working, but am struggling with the complexity of the conditionals in the phone number element. The 'extension' does NOT need to be included in the phone call link. All of the {JSX} included is being carried over as props. Code is below:

`<p className="cxEmail"><a className="emailLink" href={`mailto:${EMAIL}`}>{EMAIL}</a></p>

 <p className="cxPhoneNumber">
          {AreaCode && LocalNumber ? `${AreaCode}-${LocalNumber} ${Extension `ext.${BranchPhoneExtension}` : ''}`
            : `${BranchPhoneAreaCode}-${BranchPhoneNumber} ${BranchPhoneExtension ? `ext.${BranchPhoneExtension}` : ''}`}
 </p>`

Ive been trying to get this right for hours, and have hit a wall with figuring out the correct syntax.

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!