Trouble with "React: Render a Class Component to the DOM"

Hey all. My code is the following:

class TypesOfFood extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h1>Types of Food:</h1>
        {/* change code below this line */}
          <Fruits />
          <Vegetables />
        {/* change code above this line */}
      </div>
    );
  }
};

// change code below this line
ReactDOM.render(<TypesOfFood />, 'challenge-node');

Fruits, Vegetables, and ‘challenge-node’ are all supposed to be defined “behind the scenes” but I keep getting minified error #200, which says “target container is not a DOM element.” Am I missing something here?

try using
getElementById('challenge-node')

1 Like

try adding document. to your call to getElementByid.

ex: document.getElementById('challenge-node'));