Use React to Render Nested Components help

Tell us what’s happening:

Your code so far


const TypesOfFruit = () => {
  return (
    <div>
      <h2>Fruits:</h2>
      <ul>
        <li>Apples</li>
        <li>Blueberries</li>
        <li>Strawberries</li>
        <li>Bananas</li>
      </ul>
    </div>
  );
};

const Fruits = () => {
  return (
    <div>
 
      <Fruits />
      
    </div>
  );
};

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

  render() {
    return (
      <div>
        <h1>Types of Food:</h1>
        { /* change code below this line */ }
       <ul /> <li />
        { /* change code above this line */ }
      </div>
    );
  }
};

Your browser information:

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

Link to the challenge:

No need to think too much about this challenge.

TypesOfFood component should return Fruits component. By convention, you wrap them with angle brackets like <Fruits />. You are returning ul li which you shouldn’t because the nested component returns them anyway.

Your Fruits component should also return TypesOfFruit component.

If you are confused, I would go back to the rest of the exercises on React.