import { useEffect, useState } from "react"; import { Button, StyleSheet, Text, View } from "react-native"; import * as Settings from "expo-settings"; export default function App() { const [theme, setTheme] = useState(Settings.getTheme()); useEffect(() => { const subscription = Settings.addThemeListener(({ theme: newTheme }) => { console.log({ newTheme }); console.log({ theme }); setTheme(newTheme); }); return () => subscription.remove(); }, [setTheme]); return ( Preferred theme: {theme}