Open
Description
Summary
I am using @react-navigation/native-stack, react-native 0.79 (new Architecture) and noticed an issue with new versions of this package.
When I navigate from screen with map to another screen and go back, map loses it's position. And it is not even rerendered. Only android.
Reproducible sample code
const MainScreen = () => {
return (
<View style={{flex: 1}}>
<MapView style={{flex: 1}} provider={'google'} />
<Pressable onPress={() => navigationRef.navigate('Profile'} style={{position: 'absolute', top: 50, left: 50, backgroundColor: 'red', width: 50, height: 50}}></Pressable>
</View>
);
};
export default MainScreen;
Steps to reproduce
- MainScreen has . It is as simple as it could be.
- We navigate to another screen with navigation.navigate('screenB') - common pattern.
- We go back go MainScreen (no matter how, swiper or navigation.goBack())
- Map loses it's position and shows default position if Africa with max zoom level I suppose.
Expected result
Like in IOS map should not change it's region.
Actual result
Map changes position although it's component is not rerendered.
React Native Maps Version
1.24.3, maybe earlier
What platforms are you seeing the problem on?
Android
React Native Version
0.79.1 (new Architecture)
What version of Expo are you using?
Not using Expo
Device(s)
Samsung A05
Additional information
No response