Need help with Render State in the User Interface Another Way

Need help with Render State in the User Interface Another Way
0.0 0

#1

Hello all,

I tried the challenge https://learn.freecodecamp.org/front-end-libraries/react/render-state-in-the-user-interface-another-way
But I am stuck with the completion of third test case,
Here is the code for that. I don’t know where I am wrong?


class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      name: 'freeCodeCamp'
    }
  }
  render() {
    // change code below this line
    var res=this.state.name;
    // change code above this line
    return (
      <div>
        { /* change code below this line */ }
            <h1>{res}</h1>
        { /* change code above this line */ }
      </div>
    );
  }
};

THank you.


#2

Your code is fine, but the tester expects the variable name to be named name and not res for the challenge to pass


#3

It worked. Thanks @Dereje1