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

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

#1

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?


#2

try using
getElementById('challenge-node')