`renderItem` will be called when user scroll the slide
See original GitHub issueWhen scrolling the slide, the renderItem
method will be called many times. It’s a performance issue.
Related code: https://github.com/xiaolin/react-image-gallery/blob/master/src/ImageGallery.jsx#L1037
It’s because of we will call the method every time when the slide rerender. When the user scrolls the slide, we need to change the style
, it will cause re-render.
I guess we don’t need to call the renderItem
every time when the style
change.
And also, I suggest adding a note in README to suggest return a pure component. Could we change this one to return a PureComponent: https://github.com/xiaolin/react-image-gallery/blob/master/src/ImageGallery.jsx#L885
If you are okey with this, I can help to send a PR.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
React native Flatlist doesn't scroll - Stack Overflow
First of your dataToRender16 must have some unique id ,and you must add keyExtractor to your FlatList. checkout the following example:
Read more >Vertical and Horizontal Scrolling in a SectionList/FlatList
In the mobile app the home screen allows you to scroll both vertically (across different groups) and horizontally (within a group). Here's how...
Read more >ScrollView - React Native
Called when the user stops dragging the scroll view and it either stops or begins to glide. Type. function. onScrollToTop. iOS. . Fires...
Read more >React Native Scroll Item animation effect - FlatList ... - YouTube
In this video tutorial we will create an amazing scrolling animation/effect that you can apply to the items from a FlatList, ScrollView, ...
Read more >How to Create React Native FlatList Load More On Scroll
Check out on udemy: https://bit.ly/3vbA1LX#ReactNative #FlatListLoadMore #expoThis is the video about how we can add load more funcanality ...
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 FreeTop 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
Top GitHub Comments
Fixed in
1.2.6
https://github.com/xiaolin/react-image-gallery/releases/tag/v1.2.6@xiaolin Is this fixed?
Thanks.