From af3048964d59e83d0ad4d99e4f4dd07611ec8bad Mon Sep 17 00:00:00 2001 From: Maksymilian Galas Date: Fri, 4 Oct 2024 12:15:20 +0200 Subject: [PATCH] fix(iOS): full screen modal crash on paper (#2336) ## Description Full screen modal was crashing sometimes on Paper. Fixes #2317. ## Test code and steps to reproduce Added `Test2317` to tests. ## Checklist - [x] Included code example that can be used to test this change - [ ] Ensured that CI passes --------- Co-authored-by: Kacper Kafara --- apps/src/tests/Test2317.tsx | 85 +++++++++++++++++++++++++++++++ apps/src/tests/index.ts | 1 + ios/RNSScreenStackHeaderConfig.mm | 8 +++ 3 files changed, 94 insertions(+) create mode 100644 apps/src/tests/Test2317.tsx diff --git a/apps/src/tests/Test2317.tsx b/apps/src/tests/Test2317.tsx new file mode 100644 index 0000000000..799e46519f --- /dev/null +++ b/apps/src/tests/Test2317.tsx @@ -0,0 +1,85 @@ +import * as React from 'react'; +import { NavigationContainer } from '@react-navigation/native'; +import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack'; +import { DarkTheme, DefaultTheme } from '@react-navigation/native'; +import { Button, StyleSheet, Text, useColorScheme } from 'react-native'; +import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; +import { Colors } from 'react-native/Libraries/NewAppScreen'; + +const Stack = createNativeStackNavigator(); + +const App = (): React.JSX.Element => { + const isDarkMode = useColorScheme(); + + return ( + + + + + ({ + presentation: 'fullScreenModal', + headerTitle: () => ( + + Header Title + + ) + })} + /> + + + + ); +}; + +const FullScreenModal = ({ navigation }: NativeStackScreenProps<{}>) => { + const isDarkMode = useColorScheme() === 'dark'; + + return ( + + FullScreenModal +