message: fix: live color mode change
diff: @@ -6,7 +6,8 @@ import type {
  } from './types';
  import { HybridContext } from './../hybrid-overlay/Context';
  import type { IHybridContextProps } from './../hybrid-overlay/types';
  -import { Appearance } from 'react-native';
  +import { AppState, useColorScheme as _useColorScheme } from 'react-native';
  +import { useSubscription } from 'use-subscription';
  export const useColorMode = (): IColorModeContextProps => {
  const {
  @@ -25,12 +26,44 @@ export function useColorModeValue(light: any, dark: any) {
  return colorMode === 'dark' ? dark : light;
  }
  +export const useAppState = () => {
  + const subscription = React.useMemo(
  + () => ({
  + getCurrentValue: () => AppState.currentState,
  + subscribe: (callback: () => void) => {
  + const appStateSubscription = AppState.addEventListener(
  + 'change',
  + callback
  + );
  + //@ts-ignore
  + return () => appStateSubscription.remove();
  + },
  + }),
  + []
  + );
  + return useSubscription(subscription);
  +};
  +
  +export const useColorScheme = () => {
  + const colorScheme = _useColorScheme();
  + const [currentScheme, setCurrentScheme] = useState(colorScheme);
  + const appState = useAppState();
  +
  + useEffect(() => {
  + if (appState === 'active') {
  + setCurrentScheme(colorScheme);
  + }
  + }, [appState, colorScheme]);
  +
  + return currentScheme;
  +};
  +
  export function useModeManager(
  initialColorMode: ColorMode,
  useSystemColorMode: boolean | undefined,
  colorModeManager?: StorageManager
  ) {
  - const systemColorMode = Appearance.getColorScheme();
  + const systemColorMode = useColorScheme();
  if (useSystemColorMode) {
  initialColorMode = systemColorMode;
  