-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
More than 9 items in the data causes the Carousel to re-render all the items indefinitely #329
Comments
Hi @amitassaraf, This clearly looks like a React Native bug. First, have you made sure that your carousel is not a child of a Then, does the issue persist with a newer version of React Native? The |
@bd-arc Yes the Carousel is definitely not a direct child of ScrollView. React Navigation might be using a ScrollView somewhere, could this be the issue? |
@amitassaraf I can't find the exact issue again, but I remember reading that when a This may have been fixed since then; that's why I recommend that you try with a newer version of React Native. |
@bd-arc I upgraded to 0.55 with no luck. I will tomorrow try to use the carousel on a page outside the React Navigation cycle to see if it works. Maybe React Navigation uses a ScrollView of some sorts. Even if this solves it I have no idea what to do, because I need React Navigation haha :) Maybe I'll look for a different navigation library :/ |
@bd-arc I have tested this in a sandbox environment and it still happens. Just use a carousel and add 10+ objects and it will infinitely render the items.
|
@amitassaraf Can you try the same thing with a regular Note that you can keep your |
I'm using the carousel as a pager, loading large local images and I'm having the same problem, but in addition, some random itens do not show. It gets worse from page 10-12 ahead. Using a PureComponent helped with unnecessary renders, but pages are still blank randomly. I'm now trying to isolate the problem and will update if I find something useful. Thanks. |
@douglaslondrina I'm definitely interested in your findings. If this is an issue with the plugin itself, I'll have to work on a fix; if this has to do with the |
@bd-arc I'll check tomorrow. My hack around this was to check inside the renderItem method if the index is the currentIndex +- 1 and only then render my element, otherwise return null :/ |
The problem really seams to be with FlatList, I tried it isolated and still got weird blank pages on android real devices (on emulator it works ok). I'm on a tight schedule and am working now with https://github.com/Flipkart/recyclerlistview lib, but I'll investigate it further as soon as possible. |
Any update on this? Ran into the same issue... |
1 similar comment
Any update on this? Ran into the same issue... |
This is same as #349 ..Please check |
I had the same issue and at-least in my case it turned out to be the case the issue was the content in the carousel component - the items were re-rendering continuously... which slowed down the carousel and made it very glitchy. So I'd suggest taking a second look at the content you put in the carousel. |
+1 on what @UdaraJay is saying. Had the same issue but was able to fix it after changing the components I've was rendering in |
has this been fixed yet? Any updates? |
I have found a fix for this issue, here I will post my carousel implementation:```
` momentumExample(number, title) {
`
|
Anyone want to solve this problem? |
My |
is any one found solution? |
Is this a bug report or a feature request?
Bug report
Have you read the guidelines regarding bug report?
Yes.
Have you read the documentation in its entirety?
Yes.
Have you made sure that your issue hasn't already been reported/solved?
Yes.
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
I only have an iOS device so I am not sure.
Is the bug reproductible in a production environment (not a debug one)?
Yes.
Have you made sure that it wasn't a React Native bug?
Yes
Have you been able to reproduce the bug in the provided example?
Yes
Environment
Environment:
React: 16.2.0
React native: 0.49.0
react-native-snap-carousel: 3.7.0
Target Platform:
iOS (8.0)
Steps to Reproduce
Expected Behavior
I thought that I would only see render calls to the items that are visible and the rest would only be called ONCE they are visible.
Actual Behavior
The carousel constantly rerenders the items non stop.
The text was updated successfully, but these errors were encountered: