title: Geocode multiple addresses with React
body: <p>I am using the <code>react-native-geocoder</code> package to geocode multiple adresses. The problem is that apparently my code has some issue with batch requests.</p>
  
  <p>Why the code works for individual requests and not for batch requests and is there a way to get around this error?</p>
  
  <pre><code>async getLocations(locations) {
    Geocoder.fallbackToGoogle(GEOCODE_API_KEY);
    this.setState({
      annotations: await Promise.all(locations.map(this.getLocation))
    });
  }
  
  async getLocation(location) {
    try {
      let res = await Geocoder.geocodeAddress(location.address);
      console.log("RESULT:", location.address, await res[0].position);
      return (
        {
          latitude: await res[0].position.lat,
          longitude: await res[0].position.lng,
          title: location.provider,
          subtitle: location.address,
        }
      );
    }
    catch(err) {
      console.log("Error fetching geodata:", err);
    }
    return null;
  }
  </code></pre>
  
  <p>result (only last request working):</p>
  
  <pre><code>Error fetching geodata Error: geocodePosition failed(…)
  Error fetching geodata Error: geocodePosition failed(…)
  Error fetching geodata Error: geocodePosition failed(…)
  Error fetching geodata Error: geocodePosition failed(…)
  Error fetching geodata Error: geocodePosition failed(…)
  RESULT getLocationPosition Object {lat: 22.544028, lng: 19.124154}
  Possible Unhandled Promise Rejection (id: 0):
  Cannot read property 'id' of null
  TypeError: Cannot read property 'id' of null
      at http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:35937:11
      at Array.map (native)
      at Constructor.render (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:35928:38)
      at Constructor.proxiedMethod [as render] (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:9036:22)
      at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22776:28)
      at ReactCompositeComponentWrapper._renderValidatedComponent (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22802:24)
      at ReactCompositeComponentWrapper._updateRenderedComponent (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22728:30)
      at ReactCompositeComponentWrapper._performComponentUpdate (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22708:6)
      at ReactCompositeComponentWrapper.updateComponent (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22627:6)
      at ReactCompositeComponentWrapper.receiveComponent (http://hostserver/index.ios.bundle?platform=ios&amp;dev=true&amp;hot=true:22527:6)
  </code></pre>