HELP! I hava an "Build error, open your browser console to learn more." and I can't do the Exercise

Tell us what’s happening:

Your code so far


class MyComponent extends React.Component {
constructor(props) {
  super(props);
}
render() {
  // change code below this line
   <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/80.0.3987.149 Safari/537.36.

Challenge: Create a React Component

Link to the challenge:

You need to return that.

I can’t because in the exercise console says “Build error, open your browser console to learn more.” and it just don’t check what I writed in the excersice.

I’m only new to React myself, but it looks like your render method is missing the “return” keyword.

2 Likes

I’m not sure what you mean that you can’t return it. The code should be

render() {
    return(
        <div><h1>Hello React!</h1></div>
    )
}

you are missing the Return statement for the render function

2 Likes

Yes, my bad. Thanks for your time! I hope you have a great day.

Yes, my bad. Thanks for your time! I hope you too to have a great day!

1 Like

You too! and you are very welcome

1 Like