From c110679c5990fbcd9f9125499bc4225b29ad5011 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Tue, 23 Apr 2024 12:05:42 +0200 Subject: [PATCH] fix: don't use AnimatedNativeScreen when stackPresentation prop is not set (#2107) ## Description All navigators except `native-stack` does not set `stackPresentation` so it resolved in `AnimatedNativeModalScreen` making all navigators that are nested or under some views not work with pressability. Follow-up to https://github.com/software-mansion/react-native-screens/pull/2028/ ## Changes - Added `undefined` case for setting AnimatedNativeScreen ## Test code and steps to reproduce You can check `Test1214.tsx` or `Test2028.tsx` (after changing import to `@react-navigation/stack`) in order to test targets of touchables. ## Checklist - [x] Ensured that CI passes --- src/components/Screen.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Screen.tsx b/src/components/Screen.tsx index 3f9a1cbd34..45767f74bc 100644 --- a/src/components/Screen.tsx +++ b/src/components/Screen.tsx @@ -79,6 +79,7 @@ export class InnerScreen extends React.Component { // Due to how Yoga resolves layout, we need to have different components for modal nad non-modal screens const AnimatedScreen = Platform.OS === 'android' || + stackPresentation === undefined || stackPresentation === 'push' || stackPresentation === 'containedModal' || stackPresentation === 'containedTransparentModal'