React - Render a Class Component to the DOM

Uncaught ReferenceError: React is not defined
what is solution?

class TypesOfFood extends React.Component {
  constructor(props) {
  render() {
    return (
        <h1>Types of Food:</h1>
        <Fruits />
        <Vegetables />

ReactDOM.render(<TypesOfFood />, document.getElementById('challenge-node'))

Your browser information:

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

Challenge: React - Render a Class Component to the DOM

Link to the challenge:

Iā€™m not seeing anything wrong with your code and when I ran it, the tests did pass. Just to clarify, you are running this in the challenge editor?

Make sure you do not have any browser extensions that are blocking anything. Clear your cache and do a hard refresh Shift + F5 of the challenge page.

Or try it in a different browser.

1 Like

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