I don't get how to use Render

I don't get how to use Render
0

#1

Tell us what’s happening:

Your code so far



class TypesOfFood extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h1>Types of Food:</h1>
        {/* change code below this line */}
      <Fruits />
      <Vegetables />
        {/* change code above this line */}
      </div>
    );
  }
};

// change code below this line
ReactDOM.render(<TypesOfFood/>,('challenge-mode'));

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

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/render-a-class-component-to-the-dom/


#2

Use document.getElementById(‘challenge-node’) as your second argument instead of simply (‘challenge-node’)


#3

First of all, @Tchoukoualeu should not have to tell you how to render a class component to the DOM. Where in the curriculum challenges have you see the syntax you are trying to use above. You need to go back the the 4th lesson in the React section to understand how to correctly render class components to the DOM (see link below).

https://learn.freecodecamp.org/front-end-libraries/react/render-html-elements-to-the-dom

Also, you have a typo. It is ‘challenge-node’ instead of ‘challenge-mode’.