Swiper freezes when adding new items
See original GitHub issueI load 15 items from the server and add them to the Swiper, when I viewed 11 items, I load 15 new items, throw out the 11 already viewed and add the new ones behind the remaining 4.
Problem is now, that the swiper freezes when I do this. Sometimes it completes the current swipe after the update, sometimes it simply keeps stuck till I swipe again.
if (itemsLeft < 5) {
const nextPage = page + 1;
const nextItems = await this.loadPage(nextPage);
items.splice(0, items.length - itemsLeft);
this.setState({
items: [...items, ...nextItems],
page: nextPage
});
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Freezing/jumps when swiping Pages in Framer-Motion
When you swipe left/right it swipes to a certain point, pauses momentarily, and then continues. It's like little freezes, and I've identified it ......
Read more >Swiper Changelog
Dom7 update to latest v2.0.6: Fixed issue with remove event listeners when they was not added. Minor fixes. 4.2.6 - Released on May...
Read more >The app is freezing or crashing iOS | Driving & Delivering
From the home screen, swipe up from the bottom of your screen and pause in the middle of the screen. Swipe right or...
Read more >Use your Chromebook touchpad - Google Support
To go forward to a page you were just on, swipe right with two fingers. See all open windows ... Drag the item...
Read more >Slow rendering - Android Developers
If you frequently see inflation causing jank as new items come on screen, verify that you don't have more view types than you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Discarding viewed items will create issues for swipe back …
Hi, thanks for this good library … I am trying to paginate with Firebase Firestore, I have implemented it successfully in FlatList but with deck swiper I do not start the way. When I call the onSwiped method (cardIndex) making the new request with the last element I get this error … Warning: Can’t call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
onSwiped = async () => { const {users} = this.props; let lastUsers = users && users[users.length - 1]; console.log(‘lastUsers’, lastUsers); let nextQuery = await this.props.getUsersQuery(lastUsers); console.log(‘nextQuery’, nextQuery); }