Undefined не является объектом, оценивающим this.state / this.props

Как связать функцию вне области видимости в React Native? Я получаю ошибки:

undefined is not an object evaluating this.state   

&

undefined is not an object evaluating this.props

Я использую метод рендеринга, чтобы вызватьrenderGPSDataFromServer() когда данные были загружены. Проблема в том, что я пытаюсь использовать_buttonPress() а такжеcalcRow() ВнутриrenderGPSDataFromServer()Но я получаю эти ошибки.

я добавил

constructor(props) {
    super(props);
    this._buttonPress = this._buttonPress.bind(this);
    this.calcRow = this.calcRow.bind(this);

моему конструктору, и я изменился_buttonPress() { в_buttonPress = () => { и до сих пор ничего.

Я думаю, что понимаю проблему, но я не знаю, как ее исправить:

renderLoadingView() {
    return (
        <View style={[styles.cardContainer, styles.loading]}>
            <Text style={styles.restData}>
                Loading ...
            </Text>
        </View>
    )
}

_buttonPress = () =>  {
    this.props.navigator.push({
        id: 'Main'
    })
}

renderGPSDataFromServer =() => {
    const {loaded} = this.state;
    const {state} = this.state;

    return this.state.dataArr.map(function(data, i){
        return(
            <View style={[styles.cardContainer, styles.modularBorder, styles.basePadding]} key={i}>
                <View style={styles.cardContentLeft}>
                    <TouchableHighlight style={styles.button}
                        onPress={this._buttonPress().bind(this)}>
                        <Text style={styles.restData}>View Video</Text>
                    </TouchableHighlight>
                </View>

          <View style={styles.cardContentRight}>
            <Text style={styles.restData}>{i}</Text>
            <View style={styles.gpsDataContainer}>
              <Text style={styles.gpsData}>
              {Number(data.lat).toFixed(2)}</Text>
              <Text style={styles.gpsData}>{Number(data.long).toFixed(2)}</Text>
            </View>
            <Text  style={styles.gpsData}>
            {this.calcRow(55,55).bind(this)}
            </Text>
          </View>
        </View>
      );
    });
}

render = ()=> {
    if (!this.state.loaded) {
      return this.renderLoadingView();
    }
    return(
      <View>
        {this.renderGPSDataFromServer()}
      </View>
    )
}};

Как мне исправить это и в этом случае в чем проблема?

Ответы на вопрос(4)

Ваш ответ на вопрос