Write a React Component from Scratch - it does not render

Tell us what’s happening:

Anybody can spot any error or misspelling in my code? Thanks :slight_smile:

Your code so far


// change code below this line
class MyComponent extends React.Component {
constructor(props){
    super(props);
}

//render method
render() {
    return (
        <div>
            <h1>My First React Component!</h1>
        </div>
    );
}
};

//render the component to the DOM
ReactDOM.render(<MyComponent />, getElementById('challenge-node'));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 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

Perhaps you want to use the Document method to get a node?

document.getElementById(selector)
1 Like

Damn - still these mistakes.
Thanks!