--- id: 5a24c314108439a4d4036167 title: Render a Class Component to the DOM challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions
يتم تعريف كل من مكونات Fruits Vegetables لك وراء الكواليس. تقديم كل من المكونات كأطفال من المكون TypesOfFood ، ثم تقديم TypesOfFood إلى DOM. يوجد div به id='challenge-node' متاح للاستخدام.
## Tests
```yml tests: - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().type() === "div"; })(), "The TypesOfFood component should return a single div element.");' - text: يجب أن يقوم المكون TypesOfFood مكون Fruits بعد عنصر h1 . testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(1).name() === "Fruits"; })(), "The TypesOfFood component should render the Fruits component after the h1 element.");' - text: '' testString: 'assert((function() { const mockedComponent = Enzyme.mount(React.createElement(TypesOfFood)); return mockedComponent.children().childAt(2).name() === "Vegetables"; })(), "The TypesOfFood component should render the Vegetables component after Fruits.");' - text: يجب أن يتم عرض المكون TypesOfFood إلى DOM داخل div مع challenge-node الهوية. testString: 'assert((function() { const html = document.getElementById("challenge-node").childNodes[0].innerHTML; return (html === "

Types of Food:

Fruits:

Non-Citrus:

Citrus:

Vegetables:

"); })(), "The TypesOfFood component should render to the DOM within the div with the id challenge-node.");' ```
## Challenge Seed
```jsx 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 ```
### Before Test
```jsx const Fruits = () => { return (

Fruits:

Non-Citrus:

  • Apples
  • Blueberries
  • Strawberries
  • Bananas

Citrus:

  • Lemon
  • Lime
  • Orange
  • Grapefruit
); }; const Vegetables = () => { return (

Vegetables:

  • Brussel Sprouts
  • Broccoli
  • Squash
); }; ```
## Solution
```js // solution required ```