Render a Class Component to the DOM not accepting answer

Render a Class Component to the DOM not accepting answer
0.0 0

#1

Tell us what’s happening:

i think everything is correct but why it is not accepting answer ??

Your code so far

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


Types of Food:


{/* change code below this line /}

{/
change code above this line */}


);
}
};

// change code below this line
class Fruits extends React.Component{
render(){
return (

fruits

);
}
}
class Vegetables extends React.Component{
render(){
return (
Vegetables

);
}
}

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



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

// change code below this line
class Fruits extends React.Component{
  render(){
    return (
      <div>fruits</div>
    );
  }
}
class Vegetables extends React.Component{
  render(){
    return (
      <div>Vegetables</div>
    );
  }
}

ReactDOM.render(<TypesOfFood />, document.getElementById('challenge-node'));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; 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/render-a-class-component-to-the-dom


#2

You should change the code between the indicated lines, vegetables shouldn’t be there.

By the way the problem is this:

Both the Fruits and Vegetables components are defined for you behind the scenes

You don’t have to rewrite (overwriting) them^^