Created
May 30, 2020 20:51
-
-
Save jacobp100/c6d29db97f01fcb5f6270705b6a1742f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useColorScheme } from 'react-native' | |
const styles = StyleSheet.create({ | |
titleLight: { | |
color: 'black' | |
}, | |
titleDark: { | |
color: 'white' | |
} | |
}) | |
const Example = () => { | |
const colorScheme = useColorScheme() | |
const isDark = colorScheme === 'dark' | |
return ( | |
<Text style={isDark ? styles.titleDark : styles.titleLight}> | |
Some text... | |
</Text> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment