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.

Infinite rendering problem when loop={true} && loopClonesPerSide={4} && data.length === 2

See original GitHub issue

Description

This is a bug report, reproducible both on Android and iOS.

When loop={true} and loopClonesPerSide={4}, it triggers infinite rendering problem when the data length is exactly equal to 2.

I did not observe this behavior on any other values of the above parameters.

Library Version

"react-native-snap-carousel": "3.8.4"

React-native Info

System: OS: macOS 10.15.3 CPU: (8) x64 Intel® Core™ i5-8259U CPU @ 2.30GHz Memory: 125.14 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 11.13.0 - ~/.nvm/versions/node/v11.13.0/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.11.2 - ~/.nvm/versions/node/v11.13.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: Android NDK: 21.0.6113669 IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild npmPackages: react-native: 0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
wxsmscommented, Feb 27, 2020

Same problem here, but with data.length of 4 and loopClonesPerSide=8

0reactions
dohooocommented, Oct 8, 2021

Sorry, please allow me to advertise for my open source library! ~ I think this library react-native-reanimated-carousel will solve your problem. It is a high performance and very simple component, complete with React-Native reanimated 2

Read more comments on GitHub >

github_iconTop Results From Across the Web

React useState hook causes infinite rendering - Stack Overflow
Getting this error because of fetching data and setting brands, sellers and categories to different hooks. But website works. – Güney. May 28, ......
Read more >
React Infinite render loop , when passing data as undefined ...
Describe the bug I have reproduced the problem in this repl ... React Infinite render loop , when passing data as undefined when...
Read more >
3 ways to cause an infinite loop in React - Alex Sidorenko
Uncaught Error: Too many re-renders. React limits the number of renders to prevent an infinite loop. Here are 3 potential causes of the ......
Read more >
How to Solve the Infinite Loop of React.useEffect()
useEffect() hook because it can generate infinite loops. ... triggering a re-rendering — efficiently solving the infinite loop problem.
Read more >
How to solve the React useEffect Hook's infinite loop patterns
Solve the issue of infinite loops when using the useEffect Hook in ... Here, the problem is that during each render, React redefines...
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