Render a Class Component to the DOM-help

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-node')

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36.

Link to the challenge:

Refresh your memory how to select the DOM node to render component to here:
https://learn.freecodecamp.org/front-end-libraries/react/render-html-elements-to-the-dom

Hope it helps :slight_smile:

1 Like