diff --git a/sample/src/App.tsx b/sample/src/App.tsx index 490c820a..4bc9947d 100644 --- a/sample/src/App.tsx +++ b/sample/src/App.tsx @@ -23,7 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO import type {PropsWithChildren, ReactNode} from 'react'; import React, {useEffect, useState} from 'react'; -import {Appearance, Linking, StatusBar} from 'react-native'; +import {Linking, StatusBar} from 'react-native'; import { Link, NavigationContainer, @@ -77,8 +77,6 @@ const config: Configuration = { }, }; -Appearance.setColorScheme('light'); - export type RootStackParamList = { Catalog: undefined; CatalogScreen: undefined; diff --git a/sample/src/context/Theme.tsx b/sample/src/context/Theme.tsx index 47742992..7b7dcdb8 100644 --- a/sample/src/context/Theme.tsx +++ b/sample/src/context/Theme.tsx @@ -170,7 +170,9 @@ export const ThemeProvider: React.FC< useState(defaultValue); const setColorScheme = useCallback((colorScheme: ColorScheme) => { - if (colorScheme !== ColorScheme.automatic) { + if (colorScheme === ColorScheme.automatic) { + Appearance.setColorScheme(null); + } else { Appearance.setColorScheme( colorScheme === ColorScheme.dark ? 'dark' : 'light', );