React: Write a React Component from Scratch ERROR

Tell us what’s happening:

Build error, open your browser console to learn more.
Even though i’m certain the code is perfect
Your code so far


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

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


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

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

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.

Challenge: Write a React Component from Scratch

Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/write-a-react-component-from-scratch

Welcome, Dopamine.

I am not sure if you have just copy-pasted your code an additional time, or if there is an error in that for your code you have two of the same component. Either way, recheck your post, and edit it.

Also, just watch spaces, such as the space between the ( and the keyword return.

1 Like

Yes that was exactly the problem, the space between return and (
What and eye you have!
Thanks!