title: How to fix "TypeError: this.props is undefined" in React
body: <p>I was following tutorial on React on youtube but since it is a little outdated I am getting error.</p>
  
  <p>I googled and I found some people were able to solve it by adding constructor and I have tried to add constructor to code (which is not done in tutorial) but it still gives same error.</p>
  
  <p>This is App class </p>
  
  <pre><code>import React, { Component } from 'react';
  import Main from './components/Main';
  import './App.css';
  
  class App extends Component {
    state = {
      types: [
        {
          id: 1,
          title: "Bug",
          chosen: false
        },
        {
          id: 2,
          title: "Task",
          chosen: false
        },
        {
          id: 3,
          title: "Issue",
          chosen: false
        },
      ],
  
      states: [
        {
          id: 1,
          title: "New",
          chosen: false
        },
        {
          id: 2,
          title: "In progress",
          chosen: false
        },
        {
          id: 3,
          title: "Done",
          chosen: false
        },
      ]
    }
    render() {
      return (
        &lt;div className="App"&gt;
          &lt;Main main={this.state.main} /&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p>This is Main.js</p>
  
  <pre><code>import React, { Component } from 'react';
  
  class Main extends Component {
      constructor(props) {
          super(props);
      }
      render() {
          return this.props.main.map((mai) =&gt; (
              &lt;h3&gt;{mai.title}&lt;/h3&gt;
          ));
      }
  }
  
  export default Main;
  </code></pre>
  
  <p>I am getting error "TypeError: this.props.main is undefined"</p>