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

250
Views
Why is my template not filling up correctly with data from the back end, but is filling correctly manually?

Hi everyone I have a template that I need to fill out values from the back end.

I am using lodash _.template for this purpose. I am getting the value headerValue from the back end and nothing gets rendered. BUT when I declare it like this:

let headerValue = 'Example'

everything is working correctly. So I am guessing it is a asynchronous problem, since it does not seem to me like the code has problems?

Also when I am console logging the value from the back end - the value is correct and it is not undefined.

Any Ideas? Thanks.

const Header = ({headerValue}) => {
const headerText = {
  copy:"This is my header: ${headerValue}"
}

 const compiledHeader = _.template(headerText.copy);
 headerText.copy = compiledHeader({
   headerValue
 });

/*more unrelated code*/
}
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!