Write a React Component from Scratch

Write a React Component from Scratch
0.0 0

#1

Tell us what’s happening:

Your code so far


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

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

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.87 Safari/537.36.

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


#2

ReactDOM.render(,challenge-node);

:eyes:
Here is the error, do you know how to fix it?


#3

I know what is wrong with the above… or at least one item. I am currently stuck this problem too, but I feel like my answer is right…


#4

My answer does not get a “correct” mark on the final test but I think it is an improvement over yours since it uses document.getElementById(). @Layer - do you know what is wrong with mine?

class MyComponent extends React.Component{
constructor(props){
super(props);
};
render(){
return(


My First React Component!



)
};
};

ReactDOM.render(MyComponent, document.getElementById(‘challenge-node’));


#5

I was missing the html < /> tags in mine… “reactDom.render(, document.getElement…”