第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

this._fetchData(page) is not a function?

this._fetchData(page) is not a function?

牛魔王的故事 2019-03-14 18:15:35
我在加載更多數(shù)據(jù)_fetchMoreData()的時(shí)候重新調(diào)用this._fetchData(),為什么這里會(huì)報(bào)‘this._fetchData() is not a function()’componentDidMount(){    this._fetchData(1)}//請(qǐng)求數(shù)據(jù)_fetchData(page) {    const that = this    //如果頁(yè)數(shù)不為零,則修改上滑isLoadingData的state為true;    //否則就修改下拉刷新isRefreshing的state為true    if(page !== 0){        this.setState({            isLoadingData: true        })    }else{        this.setState({            isRefreshing: true        })    }     try {        //request.get('http://www.rapapi.org/mockjs/33254/api/list?accessToken=labike&page=10')        request.get(Config.api.baseUrl + Config.api.list, {            accessToken: 'labike',            page: page        }) }_fetchMoreData(){    // if(!this._hasMoreData || this.state.isLoadingData){    //     return    // }    const page = cacleResult.nextPage    console.log(page)    this._fetchData(page)}render(){    return(        <View style={styles.container}>            <View style={styles.header}>                <Text style={styles.headerTitle}>Header</Text>            </View>            <ListView                dataSource={this.state.dataSource}                renderRow={this._renderItem}                renderFooter={this._renderFooter}                refreshControl={                    <RefreshControl                        refreshing={this.state.isRefreshing}                        onRefresh={this._onRefresh}                        tintColor="#ff0000"                        title="Loading..."                    />                }                onEndReached={this._fetchMoreData}                onEndReachedThreshold={20}                showsVerticalScrollIndicator={false}                enableEmptySections={true}            />        </View>    )}
查看完整描述

1 回答

?
心有法竹

TA貢獻(xiàn)1866條經(jīng)驗(yàn) 獲得超5個(gè)贊

this作用域的問(wèn)題,把_fetchMoreData改成箭頭函數(shù)


查看完整回答
反對(duì) 回復(fù) 2019-03-28
  • 1 回答
  • 0 關(guān)注
  • 309 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)