に私は私のScrollViewでリフレッシュ機能を追加しようとしているが、リフレッシュしようとしたとき、私はこのエラーを取得する「未定義のは...関数ではありません」を与えますここでin the documentationrefreshControlが反応し、ネイティブアプリ
は私のコード
class Schedule extends Component {
constructor(props) {
super(props);
this.state = {
refreshing: false
};
}
_onRefresh() {
this.setState({refreshing: true});
fetchData().then(() => {
this.setState({refreshing: false});
});
}
render() {
return (
<View>
<ScrollView
style={{backgroundColor: "white"}} scrollEnabled={true} horizontal={false}
refreshControl={
<RefreshControl
refreshing={this.state.refreshing}
onRefresh={this._onRefresh.bind(this)}
/>
}
>
<View>
//...Content I'm trying to refresh
</View>
</View>
</ScrollView>
)
}
}
ある例に従っていることを例からまっすぐに取られていますように私は、コード自体に何か問題であることが想像することはできません。あなたはそれがreact-native
モジュールではありませんfetchData
機能を提供しなければならない輸入のいずれか
import {View, ScrollView, RefreshControl, fetchData } from 'react-native';
fetchDataは、 'react-native'からのエクスポートではないと思います。コンポーネントで独自の 'fetchData'関数を定義する必要があります。 –
あなたは不一致のタグがあります: ' ' –
teivaz
私は確信しています:)投稿する前にたくさんのものを取り除き、物事が混ざり合った! – smuvv