title: Geocoding API - address not updating to lat long instead persisting to database as postcode text
body: <p>I am trying to use the Google geocode api to turn a postcode into lat long coordinates.</p>
  
  <p>It seems to be working when I console.log.state, however the postcode text i.e 'TW135QZ' is being persisted into the database instead of the lat long coordinates.</p>
  
  <p>Can anybody see why the lat long cords are not being persisted? I am stuck now >.&lt; </p>
  
  <p>Main bit of code:</p>
  
  <pre><code>  onCreateCat = (e, authUser) =&gt; {
      Geocode.fromAddress(this.state.address).then(
        response =&gt; {
          const { lat, lng } = response.results[0].geometry.location;
          this.setState({address: lat + ',' + lng});
        },
        error =&gt; {
          console.error(error);
        }
      )
      .then(
        this.props.firebase.cats().push({
          text: this.state.text,
          image: 'https://images.unsplash.com/photo-1518791841217-8f162f1e1131?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9',
          userId: authUser.uid,
          address: this.state.address,
        })
      )
      e.preventDefault();
    }
  </code></pre>
  
  <p>Fullcode:</p>
  
  <pre><code>const INITIAL_STATE = {
    text: '',
    address: ''
  }
  
  class AddCat extends React.Component {
  
    constructor(props) {
      super(props);
      this.state = {
        ...INITIAL_STATE
      }
    }
  
    componentDidMount() {
      // set Google Maps Geocoding API for purposes of quota management. Its optional but recommended.
      Geocode.setApiKey(process.env.REACT_APP_GOOGLEKEY);
      // set response language. Defaults to english.
      Geocode.setLanguage("en");
      // set response region. Its optional.
      // A Geocoding request with region=es (Spain) will return the Spanish city.
      Geocode.setRegion("es");
      // Enable or disable logs. Its optional.
      Geocode.enableDebug();
      // Get latidude &amp; longitude from address.
    }
  
    onCreateCat = (e, authUser) =&gt; {
      Geocode.fromAddress(this.state.address).then(
        response =&gt; {
          const { lat, lng } = response.results[0].geometry.location;
          this.setState({address: lat + ',' + lng});
        },
        error =&gt; {
          console.error(error);
        }
        ).then(
        this.props.firebase.cats().push({
          text: this.state.text,
          image: 'https://images.unsplash.com/photo-1518791841217-8f162f1e1131?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9',
          userId: authUser.uid,
          address: this.state.address,
        })
      )
      e.preventDefault();
    }
  
    onChangeText = e =&gt; {
      this.setState({ text: e.target.value });
    };
  
    onChangeAddress = e =&gt; {
      this.setState({ address: e.target.value });
    };
  
    render() {
  
      const { text, address } = this.state;
  
      console.log(this.state);
  
      return (
        &lt;div&gt;
        &lt;h1&gt;Add cat&lt;/h1&gt;
        &lt;AuthUserContext.Consumer&gt;
          {authUser =&gt; (
            &lt;div&gt;
              &lt;form onSubmit={e =&gt; this.onCreateCat(e, authUser)}&gt;
                &lt;input
                  type="text"
                  value={text}
                  onChange={this.onChangeText}
                  placeholder="Cats Name"
                /&gt;
                &lt;input
                  name="address"
                  value={address}
                  onChange={this.onChangeAddress}
                  type="text"
                  placeholder="Cats Postcode"&gt;
                &lt;/input&gt;
                &lt;button type="submit"&gt;Send&lt;/button&gt;
              &lt;/form&gt;
            &lt;/div&gt;
          )}
         &lt;/AuthUserContext.Consumer&gt;
         &lt;/div&gt;
      );
  
    }
  
  }
  
  const condition = authUser =&gt; !!authUser;
  
  export default withAuthorization(condition)(AddCat);
  </code></pre>