Https://www.freecodecamp.org/learn/front-end-libraries/react/render-state-in-the-user-interface-another-way

Tell us what’s happening:

The rendered h1 tag should include a reference to {name}

Your code so far


class MyComponent extends React.Component {
constructor(props) {
  super(props);
  this.state = {
    name: 'freeCodeCamp'
  }
}
render() {
  // change code below this line

  // change code above this line
  return (
    <div>
      { /* change code below this line */ }
      <h1>{this.state.name}</h1>

      { /* change code above this line */ }
    </div>
  );
}
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Render State in the User Interface Another Way

Link to the challenge:

Hi @Philida,

you are meant to

  • create a const called “name” above the return,
  • store the name from the state in the const
  • render the value of the const in the h1