Tell us what’s happening:
I am facing an error while executing this code. And the error is “The h1 header should contain the string Hello React!.” but I have already used a String in H1 tag. what is going wrong…?
I have also tried passing state to the h1 tag by storing string value in the state. but still its showing an error.
the challenge asked for 3 things… 1st is - The React component should return a div element. (completed)
2nd- The returned div should render an h1 header within it. (completed)
3rd- The h1 header should contain the string Hello React! (not completed)
Your code so far
class MyComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
// change code below this line
return(
<div>
<h1> 'Hello React! </h1>
</div>
);
// change code above this line
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/create-a-react-component