Use React to Render Nested Components Help 5

Use React to Render Nested Components Help 5
0

Tell us what’s happening:
I’m having massive issues with this code. I have tried what the instructions say, but it still isn’t working. What am I doing wrong here?

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>
      { /* change code below this line */ }
      TypesOfFruit
      { /* change code above this line */ }
    </div>
  );
};

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 */ }
      </div>
    );
  }
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36 Avast/74.0.1376.132.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react/use-react-to-render-nested-components/

Fruits and TypesOfFruit are components. Review a previous lesson (below) and see how components need to be written when inserted in other elements.

https://learn.freecodecamp.org/front-end-libraries/react/create-a-component-with-composition

@RandellDawson

Thank you so much! I completely forgot how to do that. I haven’t been able to get on because of school taking up my time from here, but I always try to make time to get on here whenever I get the chance to.