React - Render a Class Component to the DOM

Tell us what’s happening:
Describe your issue in detail here.
When I am running test it returns nothing and the side crashes and I literrally can not click anything. After a moment it returns a massage Out of memory
Your code so far

class TypesOfFood extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h1>Types of Food:</h1>
        {/* Change code below this line */}
  <Fruits />;
  <Vegetables />;
  ReactDOM.render(<TypesOfFood />, document.getElementById('challenge-node'));
        {/* Change code above this line */}
      </div>
    );
  }
};

// Change code below this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 OPR/100.0.0.0

Challenge: React - Render a Class Component to the DOM

Link to the challenge:

You’ve created an infinite recursive loop by having the ReactDOM.render line within the component being rendered, so it’s trying to render itself infinitely.

How can I delete the topic when I found the solution myself. And should I or Shouldn t I?

It’s too late, BWAHAHAHAHAHA you could click the “…” menu and the Flag icon and flag the topic asking for a mod to delete it.

It might be worth keeping in case the “out of memory” problem happens to someone else and they could search the forum and find this

I see high possibility of that it happens. :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.