React Native Mantine › Theming
Theme Override Example
Full example with colorSchemeValue and Button fix
Import: import { Theme Override Example } from 'react-native-mantine';
Usage
// In App.tsx
const themeOverride = {
other: {
colors: {
text: colorSchemeValue('#000', '#fff'),
background: colorSchemeValue('#FCFCFC', '#272727'),
primaryButtonBackground: colorSchemeValue('#00203E', '#2581C4'),
}
}
};
<Theme theme={themeOverride}>
<App />
</Theme>
// In any component
const theme = useTheme();
const colors = theme.fn.colorSchemeConstants(theme.other.colors);
<View style={{ backgroundColor: colors.background }}>
<Text style={{ color: colors.text }}>Themed content</Text>
</View>