0

So I'm trying to learn React here and I wrote this simple code to test out my knowledge. I was under the impression where I can just call a component regardless if it is a class or a functional component from another class component. (which is the parent one in my case) For some reason, while using Code pen there's no errors and it just renders a blank page, why??

function Wowz() {
  return (<div>Seriously?</div>);
}

class Wow extends React.Component {
  render() {
    return <span>WOw</span>;
  }
}

class Og extends React.Component {
  render() {
    return (
      <div>Salut</div>
      <Wow />
      <Wowz />
    );
  }
}

ReactDOM.render(<Og />, document.getElementById("root"));
BlueFits
  • 85
  • 8

0 Answers0