Write a React Component from Scratch minified react error 200

Tell us what’s happening:
I do not understand what is wrong with my code, I am receiving 200 which means its not finding your resources? what is the deal?

Your code so far


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

    // change code above this line
  }
};
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/73.0.3683.86 Safari/537.36.

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

render() function in a react component always needs a return statement

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

Also what is the above statement rendering to ?

hint from the challenge : There is a div with id='challenge-node'

Blockquote[quote=“Dereje1, post:2, topic:268501, full:true”]
render() function in a react component always needs a return statement

I added this I am still getting the same error

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

Also what is the above statement rendering to ?

hint from the challenge : There is a div with id='challenge-node'
[/quote]

Im not sure what your asking here, the div with id of ‘challenge-node’ is referring to the node in the dom that we wish to render the component to, as this is already explained in the challenge im not sure what your trying to say?

and how do you select a node in the dom that has an id ?

1 Like