Accessing this.state in React-Native
<p>Hi I'm new to React so bear with me. I'm want to store geoposition as a state. Seems nifty since any change in position will trigger a render, which is exactly what I want. During development I have a button that manual triggers the event by accessing the <code>lastPosition</code>. But when I do. The state is "undefined". Any clue why?</p>

<pre><code>export default class FetchProject extends Component {
    constructor(props) {
        super(props);
        this.state = {
            initialPosition: 'unknown',
            lastPosition: 'unknown',
        };
    }

    //code that sets lastposition
    componentDidMount() {
        ....
    }

    _onPressGET (){
        console.log("PressGET -&gt; " + this.state); //undefined
        var northing=this.state.initialPosition.coords.latitude; 
        //triggers error
    }

    render() {
       return (    
           &lt;View style={styles.container}&gt;
               &lt;TouchableHighlight onPress = {this._onPressGET} style = {styles.button}&gt;
                  &lt;Text&gt;Fetch mailbox&lt;/Text&gt;
               &lt;/TouchableHighlight&gt;
           &lt;/View&gt;
       );
    }
}
</code></pre>