Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't use AnimatedNativeScreen when stackPresentation prop is not set #2107

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

WoLewicki
Copy link
Member

@WoLewicki WoLewicki commented Apr 19, 2024

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

  • Ensured that CI passes

Copy link
Member

@tboba tboba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested it out on both architectures, LGTM! 🎉

@roryabraham
Copy link

verified this fixed the problem in a release build of the Expensify app

@@ -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 ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to do something like stackPresentation === 'modal' ? AnimatedNativeModalScreen : AnimatedNativeScreen - use modal when necessary and regular screen for rest, instead of specifying all the cases where it won't be a modal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check will probably be updated when modals on Android and other types of modals on iOS by @kkafar will be merged. I'd leave it like that for now and come back to it when it's done but if you feel like it should be done here, then we can do it 🤷‍♂️

@tboba tboba changed the title fix: AnimatedNativeScreen when stackPresentation not set fix: don't use AnimatedNativeScreen when stackPresentation prop is not set Apr 23, 2024
@tboba tboba merged commit c110679 into main Apr 23, 2024
2 of 3 checks passed
@tboba tboba deleted the @wolewicki/normal-screen-in-navigators branch April 23, 2024 10:05
github-merge-queue bot referenced this pull request in valora-inc/wallet Apr 24, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-screens](https://togithub.com/software-mansion/react-native-screens)
| [`^3.30.1` ->
`^3.31.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.30.1/3.31.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-screens
(react-native-screens)</summary>

###
[`v3.31.1`](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...7aa5e7b022d2aa55d05f752f7127a6d142b2b44b)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...3.31.1)

###
[`v3.31.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.31.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.1...3.31.0)

Minor release including adding support for React Native 0.74 and fixing
targets of the touchables on the JS Stack.
Thanks for following along! 💙

#### What's Changed

#### 🐛 Bug fixes

- Don't use AnimatedNativeScreen when stackPresentation prop is not set
by [@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2107](https://togithub.com/software-mansion/react-native-screens/pull/2107)
- Change retrieving window in FullWindowOverlay by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2031](https://togithub.com/software-mansion/react-native-screens/pull/2031)

#### 🔢 Miscellaneous

- Bump yarn to latest stable (4.1.1) by
[@&#8203;maciekstosio](https://togithub.com/maciekstosio) in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)
- Add RCT-Image to RNScreens.podspec by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2089](https://togithub.com/software-mansion/react-native-screens/pull/2089)
- Fix emit type parameters by
[@&#8203;mym0404](https://togithub.com/mym0404) in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)

#### New Contributors

- [@&#8203;mym0404](https://togithub.com/mym0404) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)
- [@&#8203;maciekstosio](https://togithub.com/maciekstosio) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)

#### 🙌 Thank you for your contributions!

**Full Changelog**:
software-mansion/react-native-screens@3.31.0-rc.1...3.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJucG0iLCJyZW5vdmF0ZSJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <[email protected]>
github-merge-queue bot referenced this pull request in valora-inc/wallet Apr 24, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-screens](https://togithub.com/software-mansion/react-native-screens)
| [`^3.30.1` ->
`^3.31.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.30.1/3.31.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-screens
(react-native-screens)</summary>

###
[`v3.31.1`](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...7aa5e7b022d2aa55d05f752f7127a6d142b2b44b)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...3.31.1)

###
[`v3.31.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.31.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.1...3.31.0)

Minor release including adding support for React Native 0.74 and fixing
targets of the touchables on the JS Stack.
Thanks for following along! 💙

#### What's Changed

#### 🐛 Bug fixes

- Don't use AnimatedNativeScreen when stackPresentation prop is not set
by [@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2107](https://togithub.com/software-mansion/react-native-screens/pull/2107)
- Change retrieving window in FullWindowOverlay by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2031](https://togithub.com/software-mansion/react-native-screens/pull/2031)

#### 🔢 Miscellaneous

- Bump yarn to latest stable (4.1.1) by
[@&#8203;maciekstosio](https://togithub.com/maciekstosio) in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)
- Add RCT-Image to RNScreens.podspec by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2089](https://togithub.com/software-mansion/react-native-screens/pull/2089)
- Fix emit type parameters by
[@&#8203;mym0404](https://togithub.com/mym0404) in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)

#### New Contributors

- [@&#8203;mym0404](https://togithub.com/mym0404) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)
- [@&#8203;maciekstosio](https://togithub.com/maciekstosio) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)

#### 🙌 Thank you for your contributions!

**Full Changelog**:
software-mansion/react-native-screens@3.31.0-rc.1...3.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJucG0iLCJyZW5vdmF0ZSJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <[email protected]>
shottah referenced this pull request in zed-io/kolektivo May 15, 2024
…inc#5309)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-screens](https://togithub.com/software-mansion/react-native-screens)
| [`^3.30.1` ->
`^3.31.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.30.1/3.31.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-screens/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-screens/3.30.1/3.31.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-screens
(react-native-screens)</summary>

###
[`v3.31.1`](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...7aa5e7b022d2aa55d05f752f7127a6d142b2b44b)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.31.0...3.31.1)

###
[`v3.31.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.31.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.1...3.31.0)

Minor release including adding support for React Native 0.74 and fixing
targets of the touchables on the JS Stack.
Thanks for following along! 💙

#### What's Changed

#### 🐛 Bug fixes

- Don't use AnimatedNativeScreen when stackPresentation prop is not set
by [@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2107](https://togithub.com/software-mansion/react-native-screens/pull/2107)
- Change retrieving window in FullWindowOverlay by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2031](https://togithub.com/software-mansion/react-native-screens/pull/2031)

#### 🔢 Miscellaneous

- Bump yarn to latest stable (4.1.1) by
[@&#8203;maciekstosio](https://togithub.com/maciekstosio) in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)
- Add RCT-Image to RNScreens.podspec by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2089](https://togithub.com/software-mansion/react-native-screens/pull/2089)
- Fix emit type parameters by
[@&#8203;mym0404](https://togithub.com/mym0404) in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)

#### New Contributors

- [@&#8203;mym0404](https://togithub.com/mym0404) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2087](https://togithub.com/software-mansion/react-native-screens/pull/2087)
- [@&#8203;maciekstosio](https://togithub.com/maciekstosio) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2097](https://togithub.com/software-mansion/react-native-screens/pull/2097)

#### 🙌 Thank you for your contributions!

**Full Changelog**:
software-mansion/react-native-screens@3.31.0-rc.1...3.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJucG0iLCJyZW5vdmF0ZSJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <[email protected]>
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…t set (software-mansion#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
software-mansion#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants