Closed tdvuanh closed 1 year ago
Can you please try to add the following line somewhere at the beginning of your app (before you initially import ui-lib)?
require('react-native-ui-lib/config').setConfig({appScheme: 'default'});
Hey @lidord-wix and @tdvuanh!
I can confirm the current situation. I already have this line (you mentioned) added in my project but still, the problem is present when putting the app in the background and focus again.
we found this issue belong the lib. Just now just use pacth-package to fix the problem.
@tdvuanh can you please elaborate on your fix?
UI lib use Appearance
of react-native to get Color scheme, but since iOS 13, that API return wrong colorScheme. So we decided don't use Appearance
instead use colorScheme
which returned by Scheme.getSchemaType().
Here is the patch, fix in react-native-ui-lib/src/commons/asBaseComponent.js
Description
Hello there, we are using Colors.setScheme to enable dark mode on our application. Unfortunately, when we set
Colors.setSchema('default')
, the colors of the text component will change from the color of the light scheme to the dark scheme every time we put the app in the background and bring it to the foreground again. If we setColors.setScheme('light')
or `Colors.setScheme('dark'), everything is fine.This issue happens on both the simulator and the real device also.
Steps to reproduce
Environment
Affected platforms