title: React: Parsing error: Unexpected token, expected ","
body: <p>I am merely trying to check a condition (invitesForEvent.length) and run a map loop on invitesForEvent, but am getting the error shown below:</p>
  
  <p>I am merely trying to check a condition (invitesForEvent.length) and run a map loop on invitesForEvent, but am getting the error shown below:</p>
  
  <pre><code>./src/Invites.js
    Line 36:  Parsing error: Unexpected token, expected ","
  
    34 |     console.log("this.state.invitesForEventData.length: " + 
  this.state.invitesForEventData.length );
    35 |     return (
  &gt; 36 |         {invitesForEvent.length &lt;= 0
       |                         ^
    37 |             ? 'NO ENTRIES YET'
    38 |             : invitesForEvent.map((dat) =&gt; (
    39 |                 &lt;div&gt;Event invite entry: {invitesForEvent.length}&lt;/div&gt;
  
  import React from 'react';
  import axios from 'axios';
  import CSS from './css/styles.css';
  
  class Invites extends React.Component {
  
    state = {
      invitesForEventData: [{test: []}]
    }
  
    componentDidMount() {
      this.getInvitesForEvent(this.props.eventid);
    }
  
    getInvitesForEvent = (eventid) =&gt; {
  
      console.log("eventid: " + eventid)
      axios.post('http://localhost:3001/api/getInvitesForEvent', {
          eventid: eventid
      })
      .then((response) =&gt; {
          console.log("response.data.data: ", response);
          this.setState({ invitesForEventData: response.data.data })
      })
      .catch(function (error) {
        console.log(error);
      });
  
    };
  
    render() {
      const invitesForEvent = this.state.invitesForEventData;
  
      console.log("this.state.invitesForEventData.length: " + 
  this.state.invitesForEventData.length );
      return (
          {invitesForEvent.length &lt;= 0
              ? 'NO ENTRIES YET'
              : invitesForEvent.map((dat) =&gt; (
                  &lt;div&gt;Event invite entry: {invitesForEvent.length}&lt;/div&gt;
              ))
          }
      )
    }
  }
  
  export default Invites;
  </code></pre>