Skip to content

Commit

Permalink
fix: don't use AnimatedNativeScreen when stackPresentation prop is no…
Browse files Browse the repository at this point in the history
…t 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
#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
  • Loading branch information
WoLewicki authored Apr 23, 2024
1 parent 6b694e3 commit c110679
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class InnerScreen extends React.Component<ScreenProps> {
// 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'
Expand Down

0 comments on commit c110679

Please sign in to comment.