title: How to receive JSON Object from node and display it on client side in react?
body: <p>I am sending a json object using res.json. On the client side I am trying to set the json object to a piece of state. </p>
  
  <p>Ive tried to .json() the response but that still does not let me assign it. </p>
  
  <p>This is the server side sending the JSON File</p>
  
  <pre><code>app.get('/api/getPlace', async (req, res) =&gt; {
          const response = await client.search({
              searchType: "Coffee",
              location: "San Francisco, CA",
          })
  
          const foodPlace = response.jsonBody.businesses[9];
  
          console.log(foodPlace);
          res.json(foodPlace)
      })
  </code></pre>
  
  <p>Below is the whole component file to render the json object</p>
  
  <pre><code>import React, { Component } from 'react';
  import axios from 'axios';
  
  class RandomPlace extends Component {
      constructor(props) {
          super(props);
          this.state = {
              response: {},
          };
      }
  
      async componentDidMount() {
          const res = axios.get('/api/getPlace');
          this.setState({ response: res.data })
  
      }
  
      render() {
          return (
              &lt;div&gt;
                  {this.state.response}
              &lt;/div&gt;
          );
      }
  }
  
  export default RandomPlace;
  </code></pre>