Skip to content

Commit e5cb117

Browse files
fix(mobile): returning to a tab clears its old detail instead of crashing
A tab switch pops the workspace to its list, so the tab you return to drops the detail it was showing. Its column attaches the empty placeholder and removes the old screen in one commit, but Reanimated held the removal for exiting animations inside the screen, because it only exempts legacy Screens components. Screens pushed the placeholder over the still-mounted pull request, then popped a screen that was no longer on top: debug builds crashed with "Attempt to pop non-top screen", and release builds would pop the placeholder and leave the stale pull request showing. This affects iPad and iPhone Duo columns, folded or not. Reanimated now treats Screens v5 stack, split and tab screens like legacy screens, so their removal lands in the same mount as the rest of the commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 017af25 commit e5cb117

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

‎patches/[email protected]‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h
2+
index 675b1b7..dea79ba 100644
3+
--- a/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h
4+
+++ b/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h
5+
@@ -247,7 +247,9 @@ static inline bool isRNSScreenOrStack(const std::shared_ptr<LightNode> &node) {
6+
const auto componentName = node->current.componentName;
7+
react_native_assert(componentName && "Component name is nullptr");
8+
return !std::strcmp(componentName, "RNSScreenStack") || !std::strcmp(componentName, "RNSScreen") ||
9+
- !std::strcmp(componentName, "RNSModalScreen");
10+
+ !std::strcmp(componentName, "RNSModalScreen") || !std::strcmp(componentName, "RNSStackScreen") ||
11+
+ !std::strcmp(componentName, "RNSSplitScreen") || !std::strcmp(componentName, "RNSTabsScreenIOS") ||
12+
+ !std::strcmp(componentName, "RNSTabsScreenAndroid");
13+
}
14+
15+
static inline bool isRNSScreen(const std::shared_ptr<LightNode> &node) {

‎pnpm-lock.yaml‎

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pnpm-workspace.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ patchedDependencies:
349349
350350
351351
352+
# Screens v5 stack, split and tab screens leave at once, like legacy screens. Exiting animations
353+
# inside one otherwise hold its removal for a later mount, after its stack has moved on.
354+
352355
353356
354357
# Android: a nested WebView hands a vertical drag to its scrolling parent at the page's edge.

0 commit comments

Comments
 (0)