From afa16bac8dbe216b951f0ed9bf7c3abde0404b85 Mon Sep 17 00:00:00 2001 From: moist-webDev Date: Fri, 26 May 2023 00:20:41 -0400 Subject: [PATCH] added listener if theme is set to system --- App.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/App.tsx b/App.tsx index 09ae86e..1a1b83b 100644 --- a/App.tsx +++ b/App.tsx @@ -48,6 +48,10 @@ export default function App() { const themeMode = await findThemeMode(); setTheme(theme); setThemeMode(themeMode); + Appearance.addChangeListener(({ colorScheme }) => { + const theme = (colorScheme === 'dark') ? dark : light; + setTheme(theme); + }) } fetchData() }, []);