react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

" Cannot read property 'data' of undefined" on expandable calendar arrows

Open brianbolnick opened this issue 1 year ago • 2 comments

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

I found a weird issue with our implementation that uses the expandable calendar and agenda list, where occasionally the app will crash when navigating months using the arrows, but not by swiping? Swiping to the next month works just fine, but using the next month arrow triggers the proper date changes (and in our case begins to load data), but then subsequently crashes with the error "Cannot read property 'data' of undefined" (see the error screenshot below).

It looks like it occurs in the VirtualizedSectionList class. This is running in a managed expo project v51.0.11

Expected Behavior

Same experience as swiping to navigate

Observed Behavior

What actually happened when you performed the above actions?

If there's an error message, please paste the full terminal output and error message in this code block:

 ERROR  TypeError: Cannot read property 'data' of undefined, js engine: hermes

image

Environment

Please run these commands in the project folder and fill in their results:

Also specify:

  1. Device/emulator/simulator & OS version: iOS 17 (multiple devices, emulators and physical)

Reproducible Demo

Please provide a minimized reproducible demonstration of the problem you're reporting.

Issues that come with minimal repro's are resolved much more quickly than issues where a maintainer has to reproduce themselves.

Functioning with swipe action: image

Breaking with arrows: image

Screenshots

Screenshots or gifs of the issue and the suggested fix will help us move faster with the review process.

brianbolnick avatar Jun 22 '24 04:06 brianbolnick

I had this issue, added a try-catch around scrollToLocation in agendaList.js and created a patch. It fixes the crash for me.

selvakumar-aspire avatar Sep 27 '24 05:09 selvakumar-aspire

@selvakumar-aspire do you have a fork or a branch I could pin to?

brianbolnick avatar Sep 28 '24 05:09 brianbolnick

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 22 '25 00:01 stale[bot]