Closed vozaldi closed 1 year ago
I am experiencing the same issue on android.
Update: tested on iOS and everything is working fine.
Update (2):
The issue disappeared when I changed the navigator from @react-navigation/stack
to @react-navigation/native-stack
. So the crash is only happening with @react-navigation/stack
component.
However, @react-navigation/stack
provides more customizable component which is not available in @react-navigation/native-stack
.
@Latropos Thank you for helping to review this issue.
I have updated my repo to Reanimated v3.1.0 and the issue still occurs.
@vozaldi Yes, I know. We are still working on good solution, but if you need a workaround, you can add an exiting animation to RefreshControl. 🙃
+ const AnimatedRefreshControl = Animated.createAnimatedComponent(RefreshControl);
<Animated.ScrollView
refreshControl={(
- <RefreshControl refreshing={refreshing} />
+ <AnimatedRefreshControl exiting={ZoomOut} refreshing={refreshing} />
)}
>
<Animated.View
entering={ZoomIn}
exiting={ZoomOut}
/>
</Animated.ScrollView>
Hi @Latropos
I have tested your updates, and it worked flawlessly 🚀
Thank you
I still encounter this issue on Android!
npx react-native info: System: OS: macOS 13.5.1 CPU: (20) x64 Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz Memory: 50.01 MB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 21.2.0 path: /usr/local/bin/node Yarn: version: 1.22.21 path: /usr/local/bin/yarn npm: version: 10.2.3 path: /usr/local/bin/npm Watchman: version: 2023.11.20.00 path: /usr/local/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms:
android-34 | Google Play Intel x86_64 Atom Android NDK: 22.1.7171670 IDEs: Android Studio: 2022.3 AI-223.8836.35.2231.11090377 Xcode: version: 14.2/14C18 path: /usr/bin/xcodebuild Languages: Java: version: 20.0.2 path: /usr/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.5 wanted: 0.72.5 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
<SyncedFlatlist getContentLengthStateFunction={setBudgetListContentLength} scrollAnimatedValue={scrollYAnimatedValue} style={listStyle} data={docketBudgetList} contentContainerStyle={{ flexGrow: 1, }} showsVerticalScrollIndicator={false} initialNumToRender={8} maxToRenderPerBatch={4} updateCellsBatchingPeriod={200} refreshControl={ <AnimatedRefreshControl refreshing={isRefetchingBudgetList} onRefresh={refetchBudgetList} tintColor={THEME_COLOR.primaryFontColor} size={getFontSizeScale(14)} style={{opacity: 0}} exiting={ZoomOut} /> } onEndReached={handleFetchNextPageBudget} getItemLayout={(data, index) => ({ length: isCompactView ? getFontSizeScale(36) : getFontSizeScale(45), offset: isCompactView ? getFontSizeScale(36) index : getFontSizeScale(45) index, index, })} extraData={[isCompactView, budgetListContentLength]} renderItem={renderItem} keyExtractor={keyExtractor} idFlatlist={1} ListHeaderComponent={listHeaderComponent} stickyHeaderIndices={ docketBudgetList.length > 0 ? [0] : [0] } automaticallyAdjustContentInsets automaticallyAdjustsScrollIndicatorInsets keyboardShouldPersistTaps="handled" keyboardDismissMode="on-drag" />
Description
This issue occurs after I upgraded from v2 to v3 in React Native 0.71.4.
My app keep crashing when I opened a page and pressing back button (or executing
navigation.goBack()
).I tried to reproduce the issue using bare React Native 0.71.4 project and installed both Reanimated v3 and latest React Navigation.
I found that these props are having weird behavior:
Animated.ScrollView.refreshControl
Animated.View.exiting
Whenever I add
<Animated.ScrollView refreshControl={{....}} />
with children<Animated.View exiting={...} />
the app is crashing when navigating back.Tested on Android device and emulator (Android 13, SDK 33). Crashing in both debug and production mode.
Steps to reproduce
Crash Repro:
yarn android
.Not Crashing:
refreshControl
orexiting
Snack or a link to a repository
https://github.com/vozaldi/repro-rn-reanimated-crash
Reanimated version
3.0.2
React Native version
0.71.4
Platforms
Android
JavaScript runtime
None
Workflow
React Native (without Expo)
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes