Okay, So I tried to render some code from a freecodecamp challenge to codepen.
Here is my code:
HTML:
<div id = "challenge-node"></div>
Js:
class Fruits extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h2>Fruits:</h2>
{ /* change code below this line */ }
<ul>
<li>sadflhjk</li>
<li>hafs</li>
<li>dhdjskdhfjksd</li>
</ul>
{ /* 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>
);
}
};
ReactDOM.render(<TypesOfFood/>,document.getElementById('challenge-node'))
Please tell me how to properly render it and why it doesn’t in codepen. Thanks.