Skip to content

Feat/reanimated 4 support and Fix Issues - #2727

Open
misaku wants to merge 16 commits into
gorhom:masterfrom
misaku:feat/reanimated-4-support
Open

Feat/reanimated 4 support and Fix Issues#2727
misaku wants to merge 16 commits into
gorhom:masterfrom
misaku:feat/reanimated-4-support

Conversation

@misaku

@misaku misaku commented Jul 29, 2026

Copy link
Copy Markdown

Motivation

This PR addresses critical visual glitches and layout desynchronization issues occurring on Android when using React Native Reanimated v4 with the New Architecture (Fabric). Specifically, it fixes the phenomenon where the sheet content mask collapses or the screen behind the sheet flashes through during slow pan-down gestures.

Problems Solved

Solution Approach

Instead of animating height and paddingBottom continuously during a gesture, this implementation bypasses the animation while the gesture state is ACTIVE or BEGAN. It applies the calculated layout values directly to ensure the mask geometry stays perfectly synchronized with the finger position. Once the gesture ends, the standard spring/timing animation resumes for snapping.

Related Issues & PRs

This change consolidates fixes and concepts from the following community efforts:

Additional Changes

  • Includes various stability adjustments for the New Architecture.
  • Improves scrollable synchronization within the sheet to prevent "white flash" artifacts during fast scrolling.

Mary Green and others added 15 commits June 20, 2025 10:11
This commit updates the library to fully support React Native Reanimated v4,
migrating from deprecated APIs to the new react-native-worklets package.

Changes:
- Updated babel.config.js to use 'react-native-worklets/plugin' instead of 'react-native-reanimated/plugin'
- Added 'react-native-worklets' as a peerDependency (>=0.7.0)
- Migrated all 'runOnJS' calls to 'scheduleOnRN' from react-native-worklets
- Migrated all 'runOnUI' calls to 'scheduleOnUI' from react-native-worklets
- Removed deprecated 'addWhitelistedUIProps' call (now handled by default in Reanimated 4)
- Updated README.md with Reanimated 4 support information and New Architecture requirement

Breaking changes for users:
- Reanimated 4 requires New Architecture (no support for Legacy Architecture)
- 'react-native-worklets' package must be installed when using Reanimated 4

Closes gorhom#2223
…motion' of github.com:coolsoftwaretyler/react-native-bottom-sheet into feat/reanimated-4-support
@misaku

misaku commented Jul 29, 2026

Copy link
Copy Markdown
Author

🛠️ Temporary Workaround (Until Merge)

Since this fix addresses critical issues with Reanimated v4 and the New Architecture, you can apply it immediately to your project using patch-package before the official release is merged and published.

1. Install patch-package

If you haven't already, install the dependency:

npm install patch-package --save-dev
# or
yarn add patch-package --dev
# or
bun add -d patch-package

2. Apply the Patch

Place the generated .patch file (e.g., @gorhom+Fbottom-sheet@5.2.14.patch) inside the patches/ directory in your project root. Then run:

npx patch-package @gorhom/bottom-sheet

3. Automate on Install

Ensure the patch is applied automatically after every install by adding the following to your package.json:

{
  "scripts": {
    "postinstall": "patch-package"
  }
}

@MathiasVoie

Copy link
Copy Markdown

Misaku, thank you so much for fixing this issue! 🎉💃🥳🎊

@nhutph

nhutph commented Aug 13, 2026

Copy link
Copy Markdown

when we merge this pr ?, i still waiting

Comment thread package.json Outdated
Co-authored-by: Jeroen van Warmerdam <jeronevw@hotmail.com>
triasbrata added a commit to triasbrata/react-native-bottom-sheet that referenced this pull request Aug 30, 2026
This branch is consumed directly via a git URL (blurface-app), which has no
prepare/postinstall build step wired up, so the built output needs to be
committed here rather than relying on npm's usual publish-time build.

Combines two upstream PRs on top of 5.2.14: gorhom#2727 (Reanimated 4 support:
scheduleOnRN/scheduleOnUI, Fabric gesture-sync fixes) and gorhom#2725 (fixes
present() silently no-opping forever due to an orphaned Portal entry — the
actual remaining gap after the Reanimated rename alone wasn't sufficient).
@lukasdruskis

Copy link
Copy Markdown

Any updates on this? The fix works well, would be nice to see this merged

@egarikka

egarikka commented Sep 9, 2026

Copy link
Copy Markdown

Hey, is it for for you with

"react-native-reanimated": "4.4.1",
"react-native-worklets": "0.9.1",
"react-native": "0.86.3",

for me import BottomSheet from '@gorhom/bottom-sheet'; works

but import { BottomSheetModal } from '@gorhom/bottom-sheet'; not working so like it dose not open

on RN 0.80.2 react-native-gesture-handler v2, reanimated 4.0.1 it works fine but not working with new for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Android: content mask shrinks / footer clips during pan when snapPoints are set (Reanimated 4.x)

10 participants