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

feat: dont recycle RNScreenView #2069

Merged
merged 7 commits into from
Mar 20, 2024
Merged

feat: dont recycle RNScreenView #2069

merged 7 commits into from
Mar 20, 2024

Conversation

WoLewicki
Copy link
Member

@WoLewicki WoLewicki commented Mar 19, 2024

Description

PR disabling view recycling from RNSScreenView component. It also enables us to fix long lasting issue with view recycling. This feature was added in RN 0.74 and will only work then.

Fixes #1628.

Changes

  • stop recycling RNSScreenView
  • Remove logic connected to problems with view recycling
  • Change the logic of setting push view controllers on new architecture, when transition is ongoing
  • Add if check for cases, when user navigates to more than one screen at the same time

Test code and steps to reproduce

See that modals and replace action work correctly. You can also use Test2069.tsx from FabricTestExample / TestsExample to test the behavior of replacing screens conditionally.

ios/RNSScreenStack.mm Outdated Show resolved Hide resolved
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.

LGTM! Thanks @WoLewicki for great cooperation on this! 🎉

@tboba tboba merged commit 3b35894 into main Mar 20, 2024
7 checks passed
@tboba tboba deleted the @wolewicki/add-view-recycling branch March 20, 2024 18:16
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
## Description

PR disabling view recycling from `RNSScreenView` component. It also
enables us to fix long lasting issue with view recycling. This feature
was added in RN 0.74 and will only work then.

Fixes software-mansion#1628.

## Changes

- stop recycling `RNSScreenView`
- Remove logic connected to problems with view recycling
- Change the logic of setting push view controllers on new architecture,
when transition is ongoing
- Add if check for cases, when user navigates to more than one screen at
the same time

## Test code and steps to reproduce

See that modals and `replace` action work correctly. You can also use
`Test2069.tsx` from FabricTestExample / TestsExample to test the
behavior of replacing screens conditionally.

---------

Co-authored-by: tboba <tymoteusz.boba@gmail.com>
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.

Conditional rendering of a screen shows a blank screen (new arch)
2 participants