Use React to Render Nested Components

Use React to Render Nested Components
0.0 0

#1

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>
      { /* 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 */ }

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0.

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


#2

You did not tell us what question(s) you have.


#3

I don’t how can nest components to pass this challenge.


#4

You nested the TypesOfFruit component correctly. You just need to nest Fruits component in the TypesOfFood component.


#5

I have passed this challenge.


#6

Do you help me in SASS first challenge?


#7

Post a new topic for the SASS challenge by clicking on the Ask for Help button on the challenge.


#8

I have posted this
sass topic