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>
{ /* change code below this line */ }
<Fruits/>
{ /* change code above this line */ }
<Vegetables />
</div>
);
}
};
in this following code why is the fruits code not executed first?
the output is:
Types of Food:
Fruits:
Non-Citrus:
- Apples
- Blueberries
- Strawberries
- Bananas
Citrus:
- Lemon
- Lime
- Orange
- Grapefruit
Vegetables:
- Brussel Sprouts
- Broccoli
- Squash
is only TypesOfFood getting executed because on output screen Fruits isn’t printed twice?