Feat/reanimated 4 support and Fix Issues - #2727
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
🛠️ 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
|
|
Misaku, thank you so much for fixing this issue! 🎉💃🥳🎊 |
|
when we merge this pr ?, i still waiting |
Co-authored-by: Jeroen van Warmerdam <jeronevw@hotmail.com>
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).
|
Any updates on this? The fix works well, would be nice to see this merged |
|
Hey, is it for for you with "react-native-reanimated": "4.4.1", 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 |
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