Skip to content

Feat/reanimated 4 support and Fix Issues - #2727

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

Feat/reanimated 4 support and Fix Issues#2727
misaku wants to merge 15 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"
  }
}

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)

5 participants