Skip to content

setStackRoot causes pop event on iOS #7147

Open
@jmcountryman

Description

@jmcountryman

🐛 Bug Report

On iOS, calling setStackRoot causes a pop event to be fired, which does not happen on Android (see videos in "Actual Behavior").

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

In the playground app:

  1. Comment out or remove this line in LifecycleScreen.tsx
  2. Launch the app and choose "Stack".
  3. Choose "Push Lifecycle Screen".
  4. Choose "Screen popped events".
  5. Choose "OK" on the "Screen popped event" modal (this one is expected behavior)
  6. Choose "Set Stack Root"
  7. On iOS, observe a second "Screen popped event" modal; on Android, observe no "Screen popped event" modal.

Expected Behavior

No pop event is fired, or a pop event is fired on both platforms.

Actual Behavior

A pop event is fired only on iOS.

iOS.mp4
Android.mp4

Your Environment

  • React Native Navigation version: 7.16.0
  • React Native version: 0.63.2
  • Platform(s) (iOS, Android, or both?): Both
  • Device info (Simulator/Device? OS version? Debug/Release?):
    • Pixel 3XL running Android 11
    • iOS simulator of an iPhone 12 running iOS 14.5

Reproducible Demo

https://github.com/jmcountryman/react-native-navigation/tree/setStackRoot-pop-event (diff)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions