Skip to content
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

renderItem called multiple times #160

Closed
anwersolangi opened this issue Apr 12, 2022 · 4 comments
Closed

renderItem called multiple times #160

anwersolangi opened this issue Apr 12, 2022 · 4 comments
Assignees
Labels
bug Something isn't working P3

Comments

@anwersolangi
Copy link

Describe the bug
I'm using this library along with rendering video component, but the renderItem method is called multiple times, even the items in the data is no more than 4. the issue is similar to this and I moved to this library to overcome, but in this library I'm also getting this issue.

I am using horizontal-stack, to display Item, and due to this behavior I'm facing too much flickering and lag in android.

To Reproduce
Steps to reproduce the behavior:

  1. Install this library and react-native-video library.
  2. Create a class based component, add 3-4 items in the data.
  3. Make Carousel a child of scrollview/
  4. See error

Expected behavior
RenderItem only about the number of data times, and JSFrame at 60fps when nested inside scrollview

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • react: v17.0.2
  • react-native: v0.67.3
  • react-native-reanimated: v2.2.4
  • react-native-reanimated-carousel: 2.3.4
  • react-native-gesture-handler: v1.10.3

Smartphone (please complete the following information):

  • Device: Moto One Macro
  • OS: Android 10
@anwersolangi anwersolangi added the bug Something isn't working label Apr 12, 2022
@dohooo
Copy link
Owner

dohooo commented Apr 15, 2022

I'll check this issue this weekend.

@dohooo dohooo added the P3 label Apr 19, 2022
@noma4i
Copy link

noma4i commented Apr 26, 2022

@dohooo Just caught the same issue.

@dohooo
Copy link
Owner

dohooo commented May 1, 2022

Is that going to help? @noma4i @anwersolangi
image

Maybe I don't understand your question

Add React.memo to your render item?

@dohooo
Copy link
Owner

dohooo commented May 1, 2022

I'm sorry. I was so busy. I'm back now.

@dohooo dohooo closed this as completed May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3
Projects
None yet
Development

No branches or pull requests

3 participants