FaridSafi / react-native-gifted-listview

✌️ ListView with pull-to-refresh and infinite scrolling for Android and iOS React-Native apps
MIT License
1.62k stars 290 forks source link

[error]callback is not a function #82

Open smk524198002 opened 7 years ago

smk524198002 commented 7 years ago

the warning is like this.

scazzy commented 7 years ago

@smk524198002 can you share screenshot or detail of the error?

bosquig commented 7 years ago

Got the same issue, no more detail. I'll let you know what my code looks like :

async _loadData(page = 1, callback, options) { let response = await fetch(url + page); callback(response.data); }

and in the render return : <GiftedListView rowView={(rowData) => this._renderRow(rowData)} onFetch={this._loadData} firstLoader={true} // display a loader for the first fetching pagination={true} // enable infinite scrolling using touch to load more refreshable={false} // enable pull-to-refresh for iOS and touch-to-refresh for Android withSections={false} // enable sections customStyles={{ paginationView: { backgroundColor: '#eee', }, }}

      refreshableTintColor="blue"
    />
bosquig commented 7 years ago

ok with this "onFetch={(page, callback, options) => this._loadData(page, callback, options)}" my listview is well rendered. However I still got this error : TypeError: undefined is not a function (evaluating 'callback(responseJson.data)')

Aavesh11 commented 5 years ago

<GiftedListView style={{flex:1}} automaticallyAdjustContentInsets={false} rowView={this._renderRow} onFetch={this._loadDataFromNetwork} firstLoader={true} pagination={false} refreshable={true} withSections={false} customStyles={{refreshableView:{backgroundColor: '#FFFFFF'}}} emptyView={this._renderEmptyView} ref="listView"

            />

how to use?