React-native-swipe-list-view: Crash in SectionList

Created on 4 Jun 2020  路  7Comments  路  Source: jemise111/react-native-swipe-list-view

Your issue may already be reported!
Please search on the issue tracker before creating one.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

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

Environment (please complete the following information):

  • OS: [e.g. iOS or Android]
  • RNSLV Version: [e.g. v2.0.2]
  • RN Version: [e.g. v60.0.5]

All 7 comments

Describe the bug
Create a SectionList view with a couple of sections and sticky header. Number of listitems must be large enough to not fit the entire screen. Scroll down to the last item. When you delete this item the following error is shown (in xcode):

2020-06-04 09:08:41.259 [info][tid:main][RNGestureHandlerManager.m:136] [GESTURE HANDLER] Initialize gesture handler for root view ; layer = >
2020-06-04 09:09:42.246 [error][tid:com.facebook.react.JavaScript] TypeError: y.Animated.FlatList is not a function. (evaluating 'this._listView instanceof y.Animated.FlatList')
2020-06-04 09:09:42.248 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: y.Animated.FlatList is not a function. (evaluating 'this._listView instanceof y.Animated.FlatList')
2020-06-04 09:09:42.251729+0200 AppToDate[37239:1038441] * Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: TypeError: y.Animated.FlatList is not a function. (evaluating 'this._listView instanceof y.Animated.FlatList')', reason: 'Unhandled JS Exception: TypeError: y.Animated.FlatList is not a function. (evaluating 'this._listView instanceof y.Animated.FlatList'), stack:
value@1581:3877
@278:5277
@261:2358
y@97:1125
k@97:1268
w@97:1322
R@97:1617
M@97:2401
U@97:2216
@97:13818
Pe@97:90852
Re@97:13478
Ie@97:13664
receiveEvent@97:14065
value@27:3544
@27:840
value@27:2798
value@27:812
value@(null):(null)
'
*
First throw call stack:
(
0 CoreFoundation 0x00007fff23e39f0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ad79b2 objc_exception_throw + 48
2 AppToDate 0x00000001086a3df0 RCTFormatError + 0
3 AppToDate 0x0000000108720d2a -[RCTExceptionsManager reportFatal:stack:exceptionId:suppressRedBox:] + 503
4 AppToDate 0x00000001087217ae -[RCTExceptionsManager reportException:] + 1658
5 CoreFoundation 0x00007fff23e40e8c __invoking___ + 140
6 CoreFoundation 0x00007fff23e3e071 -[NSInvocation invoke] + 321
7 CoreFoundation 0x00007fff23e3e344 -[NSInvocation invokeWithTarget:] + 68
8 AppToDate 0x00000001086d3dfa -[RCTModuleMethod invokeWithBridge:module:arguments:] + 578
9 AppToDate 0x00000001086d6084 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 246
10 AppToDate 0x00000001086d5e0c ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
11 libdispatch.dylib 0x000000010962ef11 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010962fe8e _dispatch_client_callout + 8
13 libdispatch.dylib 0x00000001096366fd _dispatch_lane_serial_drain + 788
14 libdispatch.dylib 0x000000010963728f _dispatch_lane_invoke + 422
15 libdispatch.dylib 0x0000000109642b65 _dispatch_workloop_worker_thread + 719
16 libsystem_pthread.dylib 0x00007fff51b386fc _pthread_wqthread + 290
17 libsystem_pthread.dylib 0x00007fff51b37827 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException

To Reproduce
See above. It only crashes if the list is larger than the screen. Items that are removed when the top of the SectionList is visible do not give this error.

Environment
OS: iOS
RNSLV: 3.1.0
RN: 0.62.0

Hey @marioklaver this is not happening to me. Can you please post some example code with how you're using the SwipeListView?

Also happening for me. onContentSizeChange in components/SwipeListView.js is causing the bug I believe. The useSectionList prop needs to be set to true for this to happen.

Hi @jemise111 thanks for your quick response.

I created a clean react native project:
https://github.com/marioklaver/SwipeListView

Look at:
https://github.com/marioklaver/SwipeListView/blob/master/App.tsx

If you start the application and scroll all the way to Item 12 and try to delete that one, you can reproduce the error

Maybe this has something to do with rn 0.62.0 version, because I know they changed stuff in Animations

@paulmasek you are right, Paul. If I remove the useSectionList, the app doesn't crash.

@marioklaver Thank you for that example repo! So few people are willing to do that and it is immensely helpful.

This should now be fixed in version v3.1.1

Please verify that is the case, otherwise I'll reopen this issue

@jemise111 np that's the least I could do.

Thanks for fixing this so quick!
I can confirm that it works like a charm.

Regards

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VitaliiK91 picture VitaliiK91  路  3Comments

2JJ1 picture 2JJ1  路  5Comments

baicuhaha picture baicuhaha  路  6Comments

m-ruhl picture m-ruhl  路  6Comments

Slapbox picture Slapbox  路  6Comments