What is wrong with my Code:....Render State in the User Interface Another Way

What is wrong with my Code:....Render State in the User Interface Another Way
0

Tell us what’s happening:

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> {name} </h1>
        { /* change code above this line */         }
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/render-state-in-the-user-interface-another-way

// change code below this line
PLACE YOUR CODE HERE
// change code above this line

You have not fulfilled the first requirement in the instructions:

In the MyComponent render method, define a const called name and set it equal to the name value in the component’s state .

1 Like