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.