A bug report
Android only (checked ios and everything is fine)
Yes
Environment:
React: 16.11.0
React native: 0.62.2
react-native-snap-carousel: 4.0.0-beta.4
Target Platform:
Android (9.0)
iOS (13)
The carousel never crashes
When refreshing the data list (on reaching the end, i had elements to the carousel), it crash after i try to view one of the new item I just added. The native error stack is here:
```FATAL EXCEPTION: main
Process: com.app.example, PID: 5357
java.lang.RuntimeException: com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 543
detail: View tag:545
children(0): [
],
viewsToAdd(1): [
[0,543],
],
at com.facebook.react.bridge.ReactContext.handleException(ReactContext.java:370)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:31)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:965)
at android.view.Choreographer.doCallbacks(Choreographer.java:791)
at android.view.Choreographer.doFrame(Choreographer.java:722)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: com.facebook.react.uimanager.IllegalViewOperationException: Trying to add unknown view tag: 543
detail: View tag:545
children(0): [
],
viewsToAdd(1): [
[0,543],
],
at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:513)
at com.facebook.react.uimanager.UIViewOperationQueue$ManageChildrenOperation.execute(UIViewOperationQueue.java:206)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:792)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:903)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:43)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:963)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
... 13 more
````
Just to clarify, it was working perfectly fine on version 3.9, but 3.9 was not really fluid as you know :/
I am also getting this issue on 4.0.0-beta.4, as well as on 4.0.0-beta.2.
WORKAROUND: this is caused by zindex style property. If you remove this line: { zIndex: this._getCustomDataLength() - index } line 574 of carousel.js the crash stops. But im not sure what are the consequences of that since the original issue that justify this code is still open on react native :/ @bfaulk96 you might be interested
@CarbonC @bfaulk96 Just published 4.0.0-beta.5 that should fix the issue.
Not very proud of the workaround, but at least it shouldn't have any side effect. Had to fall back on this after scrutinizing every change made between RN 0.61 and RN 0.62 that could explain this new error but not finding anything...
Most helpful comment
@CarbonC @bfaulk96 Just published
4.0.0-beta.5that should fix the issue.Not very proud of the workaround, but at least it shouldn't have any side effect. Had to fall back on this after scrutinizing every change made between RN 0.61 and RN 0.62 that could explain this new error but not finding anything...