Flatlist OnViewableItemChanged cause error TaskQueue: Error with task: undefined is not a function #22026
Labels
Bug
Component: FlatList
Component: View
Stale
There has been a lack of activity on this issue and it may be closed soon.
react native Flatlist OnViewableItemChanged cause error TaskQueue: Error with task: undefined is not a function
I tried to implement onViewableItemsChanged it worked on ios but it crashed when run on andriod both devices and emulators
Environment:
OS: macOS 10.14
Node: 8.12.0
Yarn: 1.10.1
npm: 6.4.1
Watchman: Not Found
Xcode: Xcode 10.1 Build version 10B61
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-29.0.0.tar.gz => 0.55.4
Error message
TaskQueue: Error with task: undefined is not a function (evaluating '_iteratortypeof Symbol === "function" ? Symbol.iterator : "@@iterator"')
error image
my code
`
<FlatList
data={this.state.newsfeed}
keyExtractor={(item, index) => index.toString()}
refreshControl={this._refreshControl()}
renderItem={({ item, index }) => this.renderNewsItem(item, index)}
ref={component => {
this.scroll = component;
}}
onViewableItemsChanged={this.handleMethod}
onEndReachedThreshold={0.5}
onScroll={this.handleScroll}
/>
handleMethod = ({ viewableItems, changed}) =>{
console.log("hey");
}
`
The text was updated successfully, but these errors were encountered: