title: Consume JSON data through ReactJS
body: <p>I'm new to reactjs and I'm trying to build a simple rest client. I have a json api that I'm using that contains events. However, I'm not sure how to use consume the data because it looks different from the other examples I've seen.</p>
  
  <p>In most examples, the JSON feed looks like this...</p>
  
  <p>{"employees": [{"name":"Laura", "id":"123"},{"name":"Tim", "id":456"}]}</p>
  
  <p>However the json feed that I'm using doesn't have a "employees" : descriptor (or "events" in my case)</p>
  
  <p>Instead my feed looks like this:</p>
  
  <p>[{ "id":"1","title":"event title 1"},{"id":"2", "title":"event title 2"}]</p>
  
  <p>Because of this I'm not sure how to parse the data using the tutorials that I've seen (<a href="https://spring.io/guides/tutorials/react-and-spring-data-rest/" rel="nofollow noreferrer">https://spring.io/guides/tutorials/react-and-spring-data-rest/</a>)</p>
  
  <pre><code>constructor(props) {
      super(props);
      this.state = {employees: []};
  }
  
  componentDidMount() {
      client({method: 'GET', path: '/api/employees'}).done(response =&gt; {
          this.setState({employees: response.entity._embedded.employees});
      });
  }
  </code></pre>
  
  <p>The constructor is initializing the and the setState are starting at the employees descriptor so I'm not sure how to apply this example with my data.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance</p>