Skip to content

[v4] State update warning related to BottomSheetBackdrop on closing #1376

Closed
@nihilenz

Description

@nihilenz

Bug

After upgrading to 4.4.6 from 4.3.2, we have occasionally noticed this warning related to BottomSheetBackdrop when closing the bottom sheet:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
    in BottomSheetBackdrop

BottomSheetBackdrop usage:

backdropComponent={backdropProps => (
  <BottomSheetBackdrop {...backdropProps} disappearsOnIndex={-1} appearsOnIndex={0} pressBehavior="close" />
)}

Environment info

Library Version
@gorhom/bottom-sheet 4.4.6
react-native 0.67.5
react-native-reanimated 2.2.4
react-native-gesture-handler 2.4.2

Steps To Reproduce

It happens occasionally both on Android and iOS.
I think it only happens with the modal component.
The warning appears when the sheet is closed (tap on backdrop, drag gesture or programmatically)

Reproducible sample code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions