0
Axiosを使っていくつかのものを返すためにWeb APIをポーリングします。現時点では、Axiosは、APIを実行し、それがにconsole.log言うように、私は正しい応答が返ってきたことをログに記録することができますReact-Native Axiosリクエストと未定義の小道具
(2) [Object, Object]
をしかし、私は
this.props.navigator.push({
title: "Results",
component: "SearchResults",
passProps: {response: response}
});
私が手をしようとした場合、 "TypeError: 'evalで未定義のプロパティ' props 'を読み取ることができず、this.props.navigator.pushを含む行にエラーが表示されます。
関連コード:
_axiosFetch(searchString) {
var queryURL = 'http://mourningafter.eu/DataService.php?state=get&name=' + searchString
axios.get(queryURL)
.then(function (response) {
console.log(response)
this.props.navigator.push({
title: "Results",
component: SearchResults,
passProps: {response: response}
});
})
.catch(function (error) {
console.log(error)
});
}
私は、控えめに言って混乱しています!
どのようなヘルプも素晴らしいでしょう、歓声!
にコンテキストをバインドし、それは理にかなって - 感謝を! –
あなたは大歓迎です。答えを受け入れてください。 – Andreyco