react-native-bottom-sheet
react-native-bottom-sheet copied to clipboard
[v4] | [v2] [Android] : backgroundComponent re-rendering causes BottomSheet UI to flicker
Bug
Expanded BottomSheet
content flickers when backgroundComponent
prop is updated. Only impacts android.
Environment info
Library | Version |
---|---|
@gorhom/bottom-sheet | 4.6.0 |
react-native | 0.73.2 |
react-native-reanimated | 3.6.2 |
react-native-gesture-handler | 2.14.0 |
Steps To Reproduce
- Expand
BottomSheet
- Select
Update Background
CTA - Observe
BottomSheetView
content flicker on android
Describe what you expected to happen:
-
backgroundComponent
to re-render with new color -
BottomSheet
content to remain visible and not flicker.
Reproducible sample code
https://snack.expo.dev/@mhmaidi789/bottom-sheet-v4-reproducible-issue-template
I had the same problem while rendering react-native-maps in the background. the whole map re-renders after it snaps to the first index. Temporarily solved by using an Absolute flex view & a render prop
<GestureHandlerRootView>
{renderBackdrop?.()}
<BottomSheet
ref={sheetRef}
handleComponent={PanelHandle}
snapPoints={snapPoints}
onChange={handleSnapPointChange}
animateOnMount={false}
>
{children}
</BottomSheet>
</GestureHandlerRootView>
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.