title: React project variable is not defined no-undef
body: <p>This is my first React project and I have this issue: "./src/pages/EventsPage.jsx   Line 64:  'events' is not defined  no-undef". 
  Line 64 is {events}.Variable events is declare in line 33. But why 'events' is not defined I don't understand. </p>
  
  <p>Here is the main react component.</p>
  
  <pre><code>import React, { Component } from "react";
  import Events from "./../components/Events";
  
  export default class EventsPage extends Component {
    constructor(props) {
      super(props);
  
      this.state = {
        eventData: {},
        isLoggedin: true
      };
    }
  
    componentDidMount() {
      fetch("http://localhost:5999/events/" + this.props.match.params.userId, {
        headers: {
          "Content-Type": "application/json"
        },
        method: "GET",
        mode: "cors",
        credentials: "include"
      })
        .then(response =&gt; response.json())
        .then(data =&gt; {
          if (data["code"] === 200) {
            console.log("OK");
            this.setState({
              eventData: data.events_data,
              isLoggedin: true
            });
  
            let events = this.state.eventData.map(event =&gt; (
              &lt;Events
                name={event.name}
                image_url={event.image_url}
                start_time={event.start_time}
                end_time={event.end_time}
                price={event.price}
                age_from={event.age_from}
                age_to={event.age_to}
                x_coord={event.x_coord}
                y_coord={event.y_coord}
                status={event.status}
                status_id={event.status_id}
                members_total={event.members_total}
                members_needed={event.members_needed}
                owner_id={event.owner_id}
                address={event.address}
              /&gt;
            ));
          } else {
            console.log("NOT OK");
            this.setState({
              eventData: data.events_data,
              isLoggedin: false
            });
          }
        });
    }
  
    render() {
      return { events };
    }
  }
  </code></pre>