title: How to lift state up in React from a response with Axios?
body: <p>I have a parent <code>App.js</code> component with <code>state</code> and a child <code>MapContainer.js</code> also with <code>state</code>. The child component displays a google map and I'm using the following function to lift state up from child to parent:</p>
  
  <pre><code>mapClicked = (event) =&gt; {
       const { markers } = this.state;
       let url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng='+ event.latLng.lat() + ',' + event.latLng.lng()+ '&amp;key='+ 'MYGOOGLEAPIKEY' +'';
       axios.get(url).then(response =&gt; this.setState({
         googleReverseGeolocation:response.data.results,
         markers:[{  position:{lat:event.latLng.lat(),lng:event.latLng.lng()}  }, ...markers],
         latClick:event.latLng.lat(),
         lngClick:event.latLng.lng()
       }))   
       this.props.onResultChange(event.latLng.lat(),event.latLng.lng(), **NEED A VALID 3RD ARGUMENT**)    
     }
  </code></pre>
  
  <p>and the relevant function to the parent component looks like this:</p>
  
  <pre><code> onResultChange(x,y,info){
      this.setState(
        {
          lat:x,
          lng:y,
          clickedInfoObject:info
        }
      )
    }
  </code></pre>
  
  <p><code>lat:x</code> and <code>lat:y</code> from <code>onResultChange()</code> are correctly updated from the child component from the values passed on the function i.e. <code>event.latLng.lat()</code> and <code>event.latLng.lng()</code>. However I can't use <code>response.data.results</code> from my axios request because that value is valid only within the scope of the axios request.
  How can I insert the 3rd argument for the function <code>onResultChange(event.latLng.lat(),event.latLng.lng(), **NEED A VALID 3RD ARGUMENT**)</code> to lift the state up with all 3 arguments?</p>