title: Can I export values from an arrow function in ReactJS?
body: <p>I'm trying to use pass lng lat variables to the a google maps component from a google's geocode API, however since the geocode function is an arrow function I'm unable to use the values outside of this function. Is there any way to fix this? I need to be able to use the constants lat and lng from the geocode function and pass them to the lat and lang properties in the MapWithMarker constant</p>
  
  <pre><code>Geocode.fromAddress("5th Avenue New York").then(
        response =&gt; {
           const{ lat, lng } = response.results[0].geometry.location;
  
  
        },
        error =&gt; {
          console.error(error);
        }
      );
  
  
      const MapWithAMarker = withGoogleMap(props =&gt;
        &lt;GoogleMap
          defaultZoom={0}
          defaultCenter={{ lat: lat, lng: lng }}
        &gt;
          &lt;Marker
            position={{ lat: lat, lng: lng }}
          /&gt;
        &lt;/GoogleMap&gt;
      );
  </code></pre>
  
  <p>./src/components/dashboard/ProductDetails.js
    Line 107:  'lat' is not defined  no-undef
    Line 107:  'lng' is not defined  no-undef
    Line 110:  'lat' is not defined  no-undef
    Line 110:  'lng' is not defined  no-undef</p>