Consuming Selected Theme
interface ThemeContextData {
// Helper method to change current theme.
changeTheme: (slug: string) => void,
// Current theme
theme: Theme
}Usage
const ThemedComponent = () => (
<ThemeConsumer>
{
({ theme, changeTheme }: ThemeContextData) => {
// Use theme context here..
}
}
</ThemeConsumer>
);Example: ThemePicker
Last updated
Was this helpful?