React - Compose React Components

Please indicate where i did wrong in the code. Couldn’t save this freecodecamp show i failed it, but its the same as freecodecamp hint.

Your code so far

class Fruits extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h2>Fruits:</h2>
     { /* Change code below this line */ }
  <NonCitrus />
        <Citrus  />

        { /* Change code above this line */ }
      </div>
    );
  }
};

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: React - Compose React Components

Link to the challenge:

1 Like
  1. You have the Fruits and Vegetables components twice.

  2. Make sure the Fruits component comes before the Vegetables component (depending on which of the excess components you remove).

i really appreciate your comments. Thank you.

1 Like