You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS, after toggling the OS appearance (Control Center light ↔ dark), some views with theme-driven Uniwind classes (most visibly bg-surface / bg-background) stay rendered with the previous theme's color until they receive any interaction (touch, scroll, layout change).
As far as I can tell from visual inspection, backgroundColor is the property that fails most consistently — text and border colors on the same view appear to update correctly in the cases I checked, but I have not exhaustively audited every property, so I can't rule out that others are affected too.
A single appearance flip is enough; rapidly flipping while navigating amplifies the rate but isn't required.
Swapping the navigation library to expo-router (with byte-identical screen content, same Uniwind classes, same Reanimated animations, same providers) eliminates the bug. The two branches in the linked repo are the comparison — react-navigation native-stack reproduces, expo-router does not.
Diagnostic via UniwindDiagnostics.onShadowTreeUpdate confirms Uniwind itself pushes the new theme values correctly (currentTheme, colorScheme, all nodes traversed). The miss appears to be on the iOS commit side — the new value reaches the shadow tree but isn't committed to the affected CALayer until a secondary trigger.
Already ruled out:
react-native-screens freeze path (enableFreeze(false) + freezeOnBlur:false on both navigators) — still reproduces.
StyleSheet vs className on the affected screens — no effect.
Here a short screen recording of the List → Detail → back flow with the appearance flip in step 2 — the stale bg-surface cards on the returned List screen are the clearest visual proof.
Check out the react-navigation-bug-repro branch of the linked repo, then pnpm install && pnpm expo prebuild && pnpm ios.
Open the List tab (Animated.FlatList with a sliding header overlay backed by bg-surface).
Toggle the iOS Simulator's appearance once via Control Center (Cmd+Shift+A — not Settings → Display).
Tap any card to push into Detail, then tap Back.
The cards on the returned List screen still render the previous theme's bg-surface color. Scrolling the FlatList or tapping a card forces a re-render and the colors snap to the correct theme.
Switch to the expo-router-fix-reference branch (same screens, only navigation layer differs) and repeat — bug does not reproduce.
What happened?
On iOS, after toggling the OS appearance (Control Center light ↔ dark), some views with theme-driven Uniwind classes (most visibly
bg-surface/bg-background) stay rendered with the previous theme's color until they receive any interaction (touch, scroll, layout change).As far as I can tell from visual inspection,
backgroundColoris the property that fails most consistently — text and border colors on the same view appear to update correctly in the cases I checked, but I have not exhaustively audited every property, so I can't rule out that others are affected too.A single appearance flip is enough; rapidly flipping while navigating amplifies the rate but isn't required.
Swapping the navigation library to expo-router (with byte-identical screen content, same Uniwind classes, same Reanimated animations, same providers) eliminates the bug. The two branches in the linked repo are the comparison — react-navigation native-stack reproduces, expo-router does not.
Diagnostic via
UniwindDiagnostics.onShadowTreeUpdateconfirms Uniwind itself pushes the new theme values correctly (currentTheme, colorScheme, all nodes traversed). The miss appears to be on the iOS commit side — the new value reaches the shadow tree but isn't committed to the affected CALayer until a secondary trigger.Already ruled out:
react-native-screensfreeze path (enableFreeze(false) + freezeOnBlur:false on both navigators) — still reproduces.Here a short screen recording of the List → Detail → back flow with the appearance flip in step 2 — the stale bg-surface cards on the returned List screen are the clearest visual proof.
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-04-27.at.14.04.36.mov
Steps to Reproduce
react-navigation-bug-reprobranch of the linked repo, thenpnpm install && pnpm expo prebuild && pnpm ios.bg-surface).bg-surfacecolor. Scrolling the FlatList or tapping a card forces a re-render and the colors snap to the correct theme.expo-router-fix-referencebranch (same screens, only navigation layer differs) and repeat — bug does not reproduce.Snack or Repository Link (Optional)
https://github.com/tobiasharth/uniwind-theme-flip-repro
Uniwind version
1.1.0
React Native Version
0.83.6
Platforms
iOS
Expo
Yes
Additional information