react-native-snap-carousel icon indicating copy to clipboard operation
react-native-snap-carousel copied to clipboard

Maximum update depth exceeded!

Open orcunorcun opened this issue 6 years ago • 13 comments

Bug report!

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Have you made sure that it wasn't a React Native bug?

I think, it's about react native snap carousel library.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

I tried on IOS only.

Is the bug reproductible in a production environment (not a debug one)?

I didn't try on production env.

Environment

(Write your answer here.)

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

When I try to build with last version of react native (0.60.1) the app crashed because of that error!

(Write what happened. Add screencasts/screenshots!)

Reproducible Demo

(Paste the link to a Snack example in which the issue can be reproduced. Please follow the guidelines for providing a Minimal, Complete, and Verifiable example.)

Steps to Reproduce

(Write your steps so that anyone can reproduce the issue in the Snack demo you provided.)

orcunorcun avatar Oct 01 '19 07:10 orcunorcun

image image

orcunorcun avatar Oct 01 '19 07:10 orcunorcun

The problem appear only with v.3.8.1. v.3.8.0 working well!

orcunorcun avatar Oct 01 '19 08:10 orcunorcun

Hi @orcunorcun,

This is some serious issue indeed! It clearly has to do with the migration from componentWillReceiveProps to componentDidUpdate, but I don't understand why the former didn't trigger any error while the latter does...

bd-arc avatar Oct 01 '19 08:10 bd-arc

I have the same crash when I try to render a list with the props loop={true} and loopClonesPerSide={0}. If I put loopClonesPerSide={1} it works.

nromptea42 avatar Oct 01 '19 15:10 nromptea42

I am facing the same problem with v3.8.0, and even if i add loopClonesPerSide={1} as @nromptea42 says, still same error nothing changes

ameenmattar avatar Oct 08 '19 12:10 ameenmattar

+1

quanru avatar Oct 15 '19 06:10 quanru

Also experiencing this and to add some color, I haven't changed my data or functions in anyway that would yield an infinite loop. No setStates anyway that would interfere and cause this. It also came out of nowhere and have proven that it only breaks like this when loop={true}.

dan-fein avatar Oct 28 '19 21:10 dan-fein

Any update on this? I just updated from 3.8.0 to 3.8.4 and, with no other changes, it crashes with the aforementioned error. I've turned loop to false for now, but ideally would like that value to be true.

eddyoc avatar Jan 16 '20 18:01 eddyoc

happens for me too, I turned off loop props it worked, but I need the loop prop to be true :(

ardasatata avatar Jan 23 '20 06:01 ardasatata

It may be a matter of data

superqianqian avatar Apr 26 '20 06:04 superqianqian

This seems to be a issue with the data you are passing into the carousel.

I had a _renderItem which expected some fields that where not in my incoming data. Once I corrected that, the problem went away.

kirenpillay avatar Sep 19 '21 21:09 kirenpillay

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

dohooo avatar Oct 08 '21 05:10 dohooo

Setting loop={true} for a carousel with less than N visible items according to sliderWidth crashes with "Maximum update depth exceeded". Setting the loop like loop={_.size(data) * itemWidth > screenWidth} solves the issue.

Note: reproducible only by changing the data dynamically. If setting fewer items initially, it works as expected.

"react-native-snap-carousel": "^3.9.1" platform: IOS, Android

DmitryBD avatar Apr 11 '25 07:04 DmitryBD