У меня проблема с ReactNative и axe ios. Я хотел бы сохранить URL-адрес ответа в переменной состояния, но у меня есть эта проблема:
[TypeError: undefined is not an object (evaluating 'this.setState')]
Функция:
githubGetUrl = () => {
axios({
method: 'get',
url: 'http://' + global.IP_ADDRESS + ':8080/github/link'
}).then(function(response) {
this.setState({githuburl: response.data.LINK})
console.log('Résultat [' + this.state.githuburl + ']')
}).catch(function(error) {
console.log(error)
});
}
}
Конструктор:
constructor (props) {
super(props)
this.state = {
clicked: '',
githuburl: ''
}
}
Я уже ищу в Интернете, но не могу найти причину проблемы ...
Если кто-то может мне помочь, я буду признателен.
Спасибо