Feat/reanimated 4 support and Fix Issues - #2727
Open
misaku wants to merge 15 commits into
Open
Conversation
…roid freeze issue
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
…compatibility instructions
Fix package build
…eet into feat/reanimated-4-support
…motion' of github.com:coolsoftwaretyler/react-native-bottom-sheet into feat/reanimated-4-support
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 1. Install
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BottomSheetContentheight animation (withTiming) was desynchronizing from theBottomSheetBodytransform (translateY). This caused the white background to shrink temporarily, clipping the footer or revealing the screen underneath.Solution Approach
Instead of animating
heightandpaddingBottomcontinuously during a gesture, this implementation bypasses the animation while the gesture state isACTIVEorBEGAN. 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