use this hook to gain access to mode state and setter.

const {resolvedMode, setMode} = useMode(options);
  • Source code
export const useMode = (): UseModeYeild => {
const [{ m, s }, setState] = useStore();
/** Set user preference */
return {
mode: m,
systemMode: s,
resolvedMode: (m === SYSTEM ? s : m) as ResolvedScheme,
setMode: (m: ColorSchemePreference) => setState({ s, m }),
};
};