Skip to content

Instantly share code, notes, and snippets.

@jacobp100
Created May 30, 2020 21:19
Show Gist options
  • Save jacobp100/1a6a49dca4176ae90becd33f6a402ee6 to your computer and use it in GitHub Desktop.
Save jacobp100/1a6a49dca4176ae90becd33f6a402ee6 to your computer and use it in GitHub Desktop.
import {
PlatformColor,
DynamicColorIOS as BaseDynamicColorIOS,
Platform
} from 'react-native'
// Stops this crashing when called on other platforms
const DynamicColorIOS = Platform.select({
ios: BaseDynamicColorIOS,
default: () => null
})
export const backgroundColor = Platform.select({
ios: DynamicColorIOS({light: 'white', dark: 'black'}),
android: PlatformColor('@color/background')
})
export const textColor = ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment