-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.3.0-beta.1] React-Navigation Back Button unmounts previous screen with Reanimated #2460
Comments
Issue validatorThe issue is valid! |
I'm also able to reproduce the issue in 2.3.0-beta.1 with @react-navigation/native-stack 6.2.2 and react-native-screens 3.7.2 |
I am also able to reproduce similar issue, you can check example repo https://github.com/mateusz1913/react-native-avoid-softinput/tree/master/example Package versions
When screen is dismissed (via back button or hardware back press), it is pushed again on screen, which makes app not responding to any user's input. |
Same for me! |
Same problem here |
Same for me |
Same here, with these package versions: "dependencies": {
"@react-native-masked-view/masked-view": "0.2.6",
"@react-navigation/bottom-tabs": "6.0.7",
"@react-navigation/devtools": "6.0.2",
"@react-navigation/native": "6.0.4",
"@react-navigation/stack": "6.0.9",
"react": "17.0.2",
"react-native": "0.65.1",
"react-native-gesture-handler": "1.10.3",
"react-native-reanimated": "2.3.0-beta.1",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "3.8.0"
}
The issue only appears in the release version (using |
Same issue here. |
I confirm Same issue . When will the fix be available? |
This resolves it for me: #2477 (comment) |
The same for me :(
|
same for me |
same for me. needed RN 0.66 for preparing the support on iOS 15 and Android 12. |
I have the same error, and I can confirm that the AAR here fixes things for me. @piaskowyk would it make sense to release 2.2.3, with an aar for rn .66? |
I mean, this fix works because it uses version < 2.3 We still need a fix for version 2.3 on android 😅 |
I guess many people upgraded to 2.3.0-beta.x only because it supports RN 0.66.0. A new patch release that supports it would unblock all those many people. |
I prepared a version of 2.2.2 that is compatible with RN66 here: https://github.com/savv/react-native-reanimated/tree/2.2.6 You can use it in your react native project like this: |
Just tested with v2.2.3 on android and the issue solved 🎉🎉🎉 |
Thank you for your temporary version @savv! I have updated to 2.2.3 on Android now and the issue is solved 🎉 |
Don't want a wrong impression to arise here: the issue is not solved. The issue is still existing for the beta version of 2.3.0. |
The issue seems to still persist on the latest package versions: "react-native": "0.66.1",
"react-native-reanimated": "2.3.0-beta.3", |
Same issue:
|
Same error for me , however running in emulator is fine but not working in real device , I am testing on Samsung Note 5 |
## Description Animations of disappearing for native stack elements are more complicated, so we decided to disable this type of animation at this moment. It's just a temporary solution. We will come back to this after a stable release. Fixes: #2460 #2501 Autors: @piaskowyk @WoLewicki ## Example code <details> <summary>example 1</summary> ```js import {NavigationContainer} from '@react-navigation/native'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import React from 'react'; import {Button, Text, View} from 'react-native'; const Stack = createNativeStackNavigator(); function HomeScreen({navigation}) { return ( <View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> <Text>Home Screen</Text> <Button title="navigate" onPress={() => navigation.navigate('Next')} /> </View> ); } const NextScreen = () => { return ( <View> <Text>Some Text</Text> <Button title="Navigate" /> </View> ); }; const App = () => { return ( <NavigationContainer> <Stack.Navigator> <Stack.Screen name="Home" component={HomeScreen} /> <Stack.Screen name="Next" component={NextScreen} /> </Stack.Navigator> </NavigationContainer> ); }; export default App; ``` </details> <details> <summary>example 2</summary> ```js import React, { useState } from 'react'; import {Text, View, Button} from 'react-native'; import {NavigationContainer} from '@react-navigation/native'; import {createNativeStackNavigator} from '@react-navigation/native-stack'; import {ReanimatedScreenProvider} from 'react-native-screens/reanimated'; import {createStackNavigator} from '@react-navigation/stack'; const Stack = createStackNavigator(); let mleko = { isLogged: false } let rerender = null; const HomeScreen = () => { return ( <View style={{flex: 1}}> <View style={{flex: 1, padding: 60}}> <Text>Logged</Text> </View> </View> ); }; const LoginScreen = (props: any) => { return ( <View style={{flex: 1}}> <View style={{flex: 1, padding: 60}}> <Button onPress={() => { mleko.isLogged = true; rerender(Math.random()); console.log("mleko"); }} title="Login" /> </View> </View> ); } export const HomeNavigator = () => { return ( <Stack.Navigator screenOptions={{headerShown: false, gestureEnabled: true}}> <Stack.Screen name="Home" component={HomeScreen} /> </Stack.Navigator> ); }; export const LoginNavigator = () => { return ( <Stack.Navigator screenOptions={{ headerShown: false, gestureEnabled: true, }}> <Stack.Screen name="Login" component={LoginScreen} /> </Stack.Navigator> ); }; function RootNavigator() { const [a, setA] = useState(1); rerender = setA; return ( <Stack.Navigator screenOptions={{ headerShown: true, gestureEnabled: true, }}> {mleko.isLogged ? ( <Stack.Screen name="HomeNavigator" component={HomeNavigator} /> ) : ( <Stack.Screen name="LoginNavigator" component={LoginNavigator} /> )} </Stack.Navigator> ); }; const App = () => { return ( <ReanimatedScreenProvider> <NavigationContainer> <RootNavigator /> </NavigationContainer> </ReanimatedScreenProvider> ); }; export default App; ``` </details>
Description
After updating reanimated to the latest version 2.3.0.-beta.1 from 2.2.2 the navigation between existing screens removes interactivity as well as some styles from the screen (presumably unmounts previous screen when back button is pressed). Simple example is navigating from screen 'A' to 'B' and going back causes this bug or issue. It is only seems to affect native stack navigator.
Everything is working just fine on version 2.2.2
Expected behavior
Navigation from one screen to another and then using back button shows the previous screen as it has been before navigating.
Actual behavior & steps to reproduce
Navigation from one screen to another and then using back button unmounts the previous screen.
Snack or minimal code example
https://github.com/SultanTanirkul/navigation-reanimated-bug
Package versions
Affected platforms
The text was updated successfully, but these errors were encountered: