software-mansion / software-mansion/react-native-screens

[iOS][Stack] Swipe to go back flash of content opposite to light/dark mode

Open
#3,758 10 comments 3 reactions 1 assignee View on GitHub

@sgaczol is already working on this.

Since Mar 25, 2026.

platform:ios repro-provided
Dominant language
TypeScript
Stars
3.7k
Forks
714
Avg merge
2d 23h
Merged PRs (30d)
71

Description

Description

Swipe navigation back to previous screen on a Stack causes a flash of content that doesn't match the current theme if appearance has changed.

Locally I have patched it this way to get it more akin to what I expect

diff --git a/ios/RNSScreenStack.mm b/ios/RNSScreenStack.mm
index e37e40ab0aa83d46709a75b0fc0f7234da63cdd3..512032fbebc412827d7d425b20900de165c8be34 100644
--- a/ios/RNSScreenStack.mm
+++ b/ios/RNSScreenStack.mm
@@ -258,6 +258,9 @@
   _presentedModals = [NSMutableArray new];
   _controller = [RNSNavigationController new];
   _controller.delegate = self;
+  // Fix: prevent white flash on iOS swipe-back gesture in dark mode.
+  // The nav controller's view has no backgroundColor by default, exposing white during interactive transitions.
+  _controller.view.backgroundColor = [UIColor systemBackgroundColor];
   _sinkEventsPanGestureRecognizer = [[UIPanGestureRecognizer alloc] init];
 #if !TARGET_OS_TV && !TARGET_OS_VISION
   [self setupGestureHandlers];
Steps to reproduce
  1. Launch iOS app
  2. Change color scheme from light to dark, or dark to light, it occurs both ways with a flash of the opposite color (on ios cmd + shift + A)
  3. Swipe back with high momentum
    there will be a flash of the original themes bg color
    reproducible when starting with light, changing to dark and seeing a white bg flash
    and starting from dark, changing to light, and seeing a a black bg flash

https://github.com/user-attachments/assets/79eb0818-9a6a-4a46-8067-0edf99c1ea8a

Snack or a link to a repository

https://github.com/kieran-osgood/reproduction-react-native-screens-back-flash

Screens version

4.23.0

React Native version

0.83.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Fabric (New Architecture)

Build type

Release mode

Device

Real device

Device model

iPhone Air

Acknowledgements

Yes

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.