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

328
Views
When using Map, CSS does not get applied

The text I want to get rendered is rendered, but css is not applied. The css works perfectly when used on a item that is not mapped. On the app render method, the css gets applied, but on the message rendered, the CSS does not get applied for some reason.

I suspect that this is because of some technical issues to do with the list

const boyDivStyle = {
  backgroundColor: "blue",
  borderRadius: "25px",
  padding: "20px",
  width: 1*20 + "px",
}

class App extends Component {

  
  render() {
    return(
      <>
        <p style = {boyDivStyle}>random</p> 
        <AddHTMLTag/>
        
      </>
    )
  }
}

class MessageRenderer extends React.Component {
  render() {

    return(
      <>

        {this.state.listOfMessages.map(Message => (
          <p style = {boyDivStyle}>
             {Message}
          </p>
        ))}
      </>
    )
  }
}

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

0

const boyDivStyle = {
  backgroundColor: "blue",
  borderRadius: "25px",
  padding: "20px",
  width: 1*20 + "px",
}

class App extends Component {

  
  render() {
    return(
      <>
        <p style = {boyDivStyle}>random</p> 
        <AddHTMLTag/>
        
      </>
    )
  }
}

class MessageRenderer extends React.Component {
  render() {

    return(
      <>
        {this.state.listOfMessages.map((Message) => {
                return (<p style = {boyDivStyle}>{Message}</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!