software-mansion / software-mansion/react-native-screens
[iOS][Stack] Swipe to go back flash of content opposite to light/dark mode
@sgaczol is already working on this.
Since Mar 25, 2026.
- 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
- Launch iOS app
- 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)
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.