react-native-collapsible-tab-view icon indicating copy to clipboard operation
react-native-collapsible-tab-view copied to clipboard

FPS Drop when Swiping

Open captainAldi opened this issue 3 years ago • 2 comments

Issue:

  • When i swipe / change tab, the FPS dropped to 39-40fps ~
  • But when i change renderTab to null, its stablize in 59 fps

Existing Workaround:

  • Trying to create custom MaterialTabBar
  • using callback on it
  • but still get FPS Drop

Question:

  • Is that normal ?
  • What can i do with it to show tabbar with no FPS drop ?

Thanks

captainAldi avatar Jun 19 '22 09:06 captainAldi

Try logging your renders by adding something like console.log("rendering") and seeing if you're not re-rendering excessively while swiping tabs. You can fix it afterward by memoizing things as much as possible, either with React.memo or useMemo

andreialecu avatar Jun 20 '22 07:06 andreialecu

Yes, its re-render when i swipe.. and i tried to wrap content in each tab with React Memo.. still get fps drop

then, i just run quick start in example also get drop fps..

or could you provide example on readme ? that will probably help others too

the interisting one is, i just try to use it with https://github.com/oblador/react-native-collapsible on renderHeader component it's also laggy..

captainAldi avatar Jun 20 '22 15:06 captainAldi