Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatlist OnViewableItemChanged cause error TaskQueue: Error with task: undefined is not a function #22026

Closed
cosmosmrg opened this issue Oct 31, 2018 · 3 comments
Labels
Bug Component: FlatList Component: View Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@cosmosmrg
Copy link

cosmosmrg commented Oct 31, 2018

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");
}
`

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@stale
Copy link

stale bot commented Aug 2, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 2, 2019
@stale
Copy link

stale bot commented Aug 9, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 9, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: FlatList Component: View Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants