question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swipe performance

See original GitHub issue

Hi,

I used your component to achieve a swipe list view, but the performance seems not well on the device. I used onRightButtonsOpenRelease to close swipe when its parent scrolls, and used onSwipeStart and onSwipeRelease to close one row when the other is swiping. All codes are from your example.

Any ideas to improve the performance issue?

Cheers,

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
evekeencommented, Sep 19, 2017

I also have noticed performance issues on android devices. I don’t have many callbacks, only these:

  • onSwipeStart
  • onSwipeRelease
  • onLeftActionActivate
  • onLeftActionDeactivate
  • onLeftActionComplete
  • onRightButtonsActivate
  • onRightButtonsDeactivate

And they don’t seem to be called too often. It’s weird that I have my swipeable component working very well on iOS, but it’s slow on Android

1reaction
gabriellupucommented, Jun 20, 2018

As @peterpme suggested:

In my case, I increased performance by debouncing the swipe handlers.

Worked for me very well using lodash debounce with a 100ms wait:

import { debounce } from 'lodash';

<Swipeable
  onSwipeStart={() => {
    // ...
  }}
/>

// Debounce using lodash debounce:

<Swipeable
  onSwipeStart={debounce(() => {
    // ...
  }, 100)}
/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

ITZY "SWIPE" Performance Video (4K) - YouTube
ITZY " SWIPE " Performance Video (4K)ITZY The 1st Album "CRAZY IN LOVE"https://orcd.co/crazyinlove Find ITZY "LOCO" onMelOn ...
Read more >
ITZY "SWIPE" Dance Practice (5K) - YouTube
ITZY " SWIPE " Dance Practice (5K)ITZY The 1st Album "CRAZY IN ... LE SSERAFIM (르세라핌) 'ANTIFRAGILE' Special Performance Video. LE SSERAFIM.
Read more >
ITZY - SWIPE (Music Bank) | KBS WORLD TV 211015
ITZY - SWIPE (Music Bank) | KBS WORLD TV 211015 #ITZY(있지) ... 2022 DEBUT GIRL GROUP PERFORMANCE TOP 10 | [STUDIO CHOOM &...
Read more >
ITZY(있지) - SWIPE @인기가요 inkigayo 20211017 - YouTube
The show features some of K-pop artists' performance every Sunday. Check out this week's Inkigayo Line up and meet your favorite artist!
Read more >
ITZY “SWIPE” M/V @ITZY - YouTube
ITZY “ SWIPE ” M/VITZY The 1st Album "CRAZY IN LOVE" https://orcd.co/crazyinloveITZY "LOCO" Listen here: YouTube ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found