Skip to content

Uniwind styles not updated on frozen screens after device theme change #466

Description

@hayata-suenaga

What happened?

When inactive screens are frozen (via enableFreeze(true) from react-native-screens or freezeOnBlur: true on expo-router/react-navigation screens), changing the device color scheme on one screen and navigating to another can show stale styles. The screen active during the color-scheme change updates correctly, but frozen screens may keep the previous theme styles.

Affected platforms: iOS and Android (real devices and simulators/emulators, development and production builds).

Suspected cause

Uniwind Pro applies theme-driven style updates by mutating the Shadow Tree directly, bypassing React's reconciliation. When freezeOnBlur (or enableFreeze) is active, react-native-screens freezes inactive screens, which likely prevents the C++ engine from delivering those shadow tree mutations to frozen screens. When the screen is unfrozen on navigation, the pending updates are never replayed.

Workaround

Disable freezeOnBlur / enableFreeze. This is undesirable in larger apps where screen freezing is important for performance.

Steps to Reproduce

  1. Create an app with at least two navigable screens (e.g. tabs/stack) styled with dark/light variants.
  2. Enable screen freezing (enableFreeze(true) in react-native-screens or freezeOnBlur: true on navigator screens).
  3. Open Screen A and change the device/system color scheme (light ↔ dark).
  4. Confirm Screen A updates correctly.
  5. Navigate to Screen B.
  6. Observe Screen B still uses styles from the previous color scheme.

Snack or Repository Link (Optional)

https://github.com/hayata-suenaga/uniwind-bug-1

Uniwind version

uniwind-pro 1.0.0-rc.6

React Native Version

0.83.2

Platforms

iOS, Android

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions