# Rendering a Class Component to the DOM

**URL:** <https://forum.freecodecamp.org/t/rendering-a-class-component-to-the-dom/209708>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [July 18, 2018, 5:41am UTC](https://forum.freecodecamp.org/t/rendering-a-class-component-to-the-dom/209708 "2018-07-18T05:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrpanchal](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mrpanchal](https://forum.freecodecamp.org/u/mrpanchal)\
**Post date:** [July 18, 2018, 5:41am UTC](https://forum.freecodecamp.org/t/rendering-a-class-component-to-the-dom/209708/1 "2018-07-18T05:41:32Z")

</div>

it’s showing the error

**Your code so far**

```jsx

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 />, document.getElementById("challange-node"));

```

**Your browser information:**

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0`.

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/front-end-development-libraries/react/render-a-class-component-to-the-dom)**
>
> Learn to Code — For Free
