Tell us what’s happening:
Hi,
can someone tell me why and how when we open the page of this challenge only the class Types of Food is represented (visible) on the console panel and class Fruits is not.
I understood that the method render() is used to represent (show) the component and the code for the two classes seems to me identical but only Types of Food is actually rendered on screen.
Cheers
Your code so far
class Fruits extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h2>Fruits:</h2>
{ /* change code below this line */ }
{ /* 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 */ }
<Vegetables />
</div>
);
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36
.
Challenge: Compose React Components
Link to the challenge: