Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] BottomSheet flickers when adding Animated component #908

Closed
nastarfan opened this issue Apr 9, 2022 · 6 comments
Closed

[v4] BottomSheet flickers when adding Animated component #908

nastarfan opened this issue Apr 9, 2022 · 6 comments
Labels
bug Something isn't working no-issue-activity

Comments

@nastarfan
Copy link

Bug

The BottomSheet is flickering when displayed after animated component has been mounted, specifically the flickering part is the BottomSheetBackdrop.

From my observation, the flickering only happens when the BottomSheet has onChange prop since removing it while still keeping the animated component dismisses the issue. Tho, keeping the onChange prop while removing the animated component also removes the issue. So it seems both cannot present at the same time, otherwise the issue will arise.

The issue exists on both BottomSheet and BottomSheetModal.
bottomsheetbug

Environment info

I have only tested this on Android

Library Version
@gorhom/bottom-sheet 4.1.5
react-native 0.68.0 (also tested on 0.67.4)
react-native-reanimated 2.6.0 (also tested on 2.5.0)
react-native-gesture-handler 2.3.2

Steps To Reproduce

  1. Add animated components (from reanimated), mounted before the bottom sheet
  2. Add bottomsheet with backdropComponent and onChange props
  3. The bottom sheet will flicker when shown

Describe what you expected to happen:

  1. The BottomSheet doesn't flicker even we have backdrop, onChange handler, and animated components

Reproducible sample code

I created a repo to reproduce the issue, specifically in this file

@nastarfan nastarfan added the bug Something isn't working label Apr 9, 2022
@nastarfan nastarfan changed the title [v4] | [v2] BottomSheet flickers when adding Animated component [v4] BottomSheet flickers when adding Animated component Apr 9, 2022
@github-actions
Copy link

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.

@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@kaogire
Copy link

kaogire commented Jul 23, 2022

@nastarfan Did you finally resolve this?

@OlehOutlierlabs
Copy link

why is this closed? this is still an issue!!!! @kaogire @nastarfan did you fix this?

@kaogire
Copy link

kaogire commented Jan 17, 2023

@OlehOutlierlabs Nah, it's still an issue

@HGCollier
Copy link

Managed to find a solution here: #208
Essentially, rather than putting a function directly into the onChange prop, create a callback instead:

const handleSheetChanges = useCallback((index: number) => {
  console.log('handleSheetChanges', index);
}, []);

onChange={handleSheetChanges}

lukmccall added a commit to expo/expo that referenced this issue Jan 15, 2024
# Why

Closes [ENG-11073](https://linear.app/expo/issue/ENG-11073)

# How

There is a bug in the Gorhom bottom sheet that causes the backdrop component to flash. It was reported a while ago, but it doesn’t seem to be resolved. Here are related issues: gorhom/react-native-bottom-sheet#208 and gorhom/react-native-bottom-sheet#908.

I've adjusted the animation to mask the disappearing backdrop component. 

# Test Plan

- Expo Go with empty app ✅
brentvatne pushed a commit to expo/expo that referenced this issue Jan 16, 2024
# Why

Closes [ENG-11073](https://linear.app/expo/issue/ENG-11073)

# How

There is a bug in the Gorhom bottom sheet that causes the backdrop component to flash. It was reported a while ago, but it doesn’t seem to be resolved. Here are related issues: gorhom/react-native-bottom-sheet#208 and gorhom/react-native-bottom-sheet#908.

I've adjusted the animation to mask the disappearing backdrop component. 

# Test Plan

- Expo Go with empty app ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

4 participants