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

329
Views
Use of variables in keys instead of hard-coded value react-intl-universal-extract

How do you extract default messages with variables or constants in the key or .get()

Example of message to extract

<p>
    {
      intl
        .get(`${PREFIX}.personal-form.name-field`)
        .defaultMessage('First name')
    }
</p>

Running react-intl-universal-extract against the code above doesn't extract default message.

However when inserting a hard-coded value instead of ${PREFIX}, a message gets extracted.

Any ideas or different approaches to this work without any hard-coded values?

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

0

Since I couldn't find a direct solution to this issue.

A workaround that helped me is by using the hard-coded string value instead of variable/constant name inside the get method.

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!