React: Write a React Component from Scratch doesn't work

// change code below this line
import React from 'react';

class MyComponent extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <div> 
                <h1>My First React Component!</h1> 
            </div>
        );
    }
};

// export default MyComponent;

ReactDOM.render(<MyComponent />, document.getElementById('challenge-node'));

Can someone tell me what am I doing wrong? :thinking:

What happens when you run the code? Do you see any errors in the browser console? What is the challenge url you are working on?

Here is the challenge’s url: https://www.freecodecamp.org/learn/front-end-libraries/react/write-a-react-component-from-scratch

These are the errors:

and the errors in the browser console:

You do not have to import React. That is done for you behind the scenes.

Perfect, it worked! Thank you very much!

Glad you got it working!

In the future, it is best to click on the Get Help button and select Ask for Help. This will create a forum topic and include all your code and the challenge url and let you ask your question. This speeds up the process of getting you the help you need.

Oh, I didn’t know that. Thanks for letting me know!