The final test says: The TypesOfFood
component should render to the DOM within the div
with the id challenge-node
. I need help, regrads. Th ecode is below:
class TypesOfFood extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div id='challenge-node'>
<h1>Types of Food:</h1>
{ /* change code below this line */ }
<Fruits />
<Vegetables />
</div>
);
}
};
const Fruits = () => {
return (
<div>
{ /* change code below this line */ }
<TypesOfFruit />
{ /* change code above this line */ }
</div>
);
};
const Vegetables = () => {
return (
<div>
{ /* change code below this line */ }
<TypesOfVegetable />
{ /* change code above this line */ }
</div>
);
};
const TypesOfFruit = () => {
return (
<div>
<h2>Fruits:</h2>
<NonCitrus />
<Citrus />
</div>
);
};
const NonCitrus = () => {
return (
<div>
<h2>NonCitrus:</h2>
<li>Apples</li>
<li>Blueberries</li>
<li>Strawberries</li>
<li>Bananas</li>
</div>
);
};
const Citrus = () => {
return (
<div>
<h2>Citrus:</h2>
<li>Lemon</li>
<li>Lime</li>
<li>Orange</li>
<li>Grapefruit</li>
</div>
);
};
const TypesOfVegetable = () => {
return (
<div>
<h2>Vegetables:</h2>
<ul>
<li>Brussel Sprouts</li>
<li>Broccoli</li>
<li>Squash</li>
<li>Fasulye</li>
</ul>
</div>
);
};
class TypesOfVehicles extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h1>Types of Vehicles:</h1>
<Car />
</div>
);
}
}
const Car = () => {
return (
<div>
{ /* change code below this line */ }
<TypesOfCars />
{ /* change code above this line */ }
</div>
);
};
const TypesOfCars = () => {
return (
<div>
<h2>Cars:</h2>
<ul>
<li>Renault</li>
<li>Nissan</li>
</ul>
</div>
);
};
ReactDOM.render(<TypesOfFood />,document.getElementById('challenge-node'));