From 378979e3cc46fc7d1d0b7b9f80669285c929d552 Mon Sep 17 00:00:00 2001 From: alduzy Date: Mon, 7 Oct 2024 22:06:23 +0200 Subject: [PATCH 01/10] fix(iOS): header snapshots not working --- ios/RNSScreenStackHeaderConfig.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/RNSScreenStackHeaderConfig.mm b/ios/RNSScreenStackHeaderConfig.mm index 04abae0cfb..bf6ca4a658 100644 --- a/ios/RNSScreenStackHeaderConfig.mm +++ b/ios/RNSScreenStackHeaderConfig.mm @@ -768,7 +768,6 @@ - (void)unmountChildComponentView:(UIView *)childCompo [self replaceNavigationBarViewsWithSnapshotOfSubview:(RNSScreenStackHeaderSubview *)childComponentView]; [_reactSubviews removeObject:(RNSScreenStackHeaderSubview *)childComponentView]; [childComponentView removeFromSuperview]; - [self updateViewControllerIfNeeded]; } - (void)replaceNavigationBarViewsWithSnapshotOfSubview:(RNSScreenStackHeaderSubview *)childComponentView From 341558b70a5b10d5c8fa5230c3a45ecca0a33f3c Mon Sep 17 00:00:00 2001 From: alduzy Date: Tue, 8 Oct 2024 15:41:44 +0200 Subject: [PATCH 02/10] updated repro --- apps/src/tests/Test556.tsx | 105 ++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 30 deletions(-) diff --git a/apps/src/tests/Test556.tsx b/apps/src/tests/Test556.tsx index 652de6cc7b..25ac688051 100644 --- a/apps/src/tests/Test556.tsx +++ b/apps/src/tests/Test556.tsx @@ -1,13 +1,17 @@ import * as React from 'react'; import { Button, StyleSheet, Text, View } from 'react-native'; import { NavigationContainer, ParamListBase } from '@react-navigation/native'; -import { NativeStackNavigationProp, createNativeStackNavigator } from '@react-navigation/native-stack'; +import { + NativeStackNavigationProp, + createNativeStackNavigator, +} from '@react-navigation/native-stack'; +import { Square } from '../shared'; const Stack = createNativeStackNavigator(); type ScreenBaseProps = { navigation: NativeStackNavigationProp; -} +}; export default function App() { return ( @@ -16,30 +20,48 @@ export default function App() { screenOptions={{ animation: 'fade', }}> - ( - - Hello there! - - ), - headerRight: () => ( - - Right-1 - - ), - }} /> - ( - - General Kenobi - - ), - headerRight: () => ( - - Right-2 - - ), - }} /> + ( + + Hello there! + + ), + headerRight: () => ( + + Right-1 + + ), + }} + /> + ( + + General Kenobi + + ), + headerRight: () => ( + + Right-2 + + ), + }} + /> ); @@ -55,11 +77,34 @@ function First({ navigation }: ScreenBaseProps) { } function Second({ navigation }: ScreenBaseProps) { + const [backButtonVisible, setBackButtonVisible] = React.useState(true); + return ( -