[React Native] DarkMode, themes

설정·2021년 12월 29일
0

ReactNative

목록 보기
17/30

# DarkMode

  1. useColorScheme()
  2. Themes
import { useColorScheme } from 'react-native';
import {
  NavigationContainer,
  DefaultTheme,
  DarkTheme,
} from '@react-navigation/native';

export default () => {
  const scheme = useColorScheme();

  return (
    <NavigationContainer theme={scheme === 'dark' ? DarkTheme : DefaultTheme}>
      {/* content */}
    </NavigationContainer>
  );
};

0개의 댓글