What happened?
Actual Behavior
The app appears to restart / activity is recreated on theme switch.
Expected Behavior
Theme switches should happen without app/activity restart.
Suspected Root Cause
In setTheme, Uniwind forces native appearance sync via Appearance.setColorScheme(...) for explicit themes.
On Android + newer RN, this seems to trigger configuration changes/activity recreation in some setups.
Workaround (validated)
Skipping Appearance.setColorScheme(...) on Android while keeping Uniwind internal theme updates and listener notifications resolves the restart behavior for us.
Steps to Reproduce
- Run an app on Android with Uniwind configured.
- Add a runtime theme switcher that calls:
Uniwind.setTheme('light')
Uniwind.setTheme('dark')
- Toggle between light and dark multiple times.
Snack or Repository Link
.
Uniwind version
1.5.0
React Native Version
0.83.0
Platforms
Android
Expo
No
Additional information
What happened?
Actual Behavior
The app appears to restart / activity is recreated on theme switch.
Expected Behavior
Theme switches should happen without app/activity restart.
Suspected Root Cause
In
setTheme, Uniwind forces native appearance sync viaAppearance.setColorScheme(...)for explicit themes.On Android + newer RN, this seems to trigger configuration changes/activity recreation in some setups.
Workaround (validated)
Skipping
Appearance.setColorScheme(...)on Android while keeping Uniwind internal theme updates and listener notifications resolves the restart behavior for us.Steps to Reproduce
Uniwind.setTheme('light')Uniwind.setTheme('dark')Snack or Repository Link
.
Uniwind version
1.5.0
React Native Version
0.83.0
Platforms
Android
Expo
No
Additional information