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

211
Views
Correct syntax to write nested object in JavaScript

This library RenderHtml in react native require source variable to be like that

{
  html: `
<p style='text-align:center;'>
  Hello World!
</p>`
};

In another screen I managed to send the correct object like so

html: { html: route.params.index.content.rendered },

but here I am inside a for loop so cannot use setState

const posts = this.state.data.map((item, index) => (
    <TouchableWithoutFeedback key={index}>
        <RenderHtml source={item.excerpt.rendered} contentWidth={width} />
    </TouchableWithoutFeedback>
  ))

I tried all of these below, doesnt work

source={html: item.excerpt.rendered}
source={'html:' + item.excerpt.rendered}
source=`{html: item.excerpt.rendered}`
source={`html: + $item.excerpt.rendered`}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Found the answer:

source={{html: item.excerpt.rendered}}
about 4 years ago · Santiago Trujillo 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!