Class: ThemeConsumer

ThemeConsumer(Component)

A higher order component utilizing messaging context to the component it wraps. The context provides a theme object and monitors changes to it using state.

Constructor

new ThemeConsumer(Component)

Parameters:
Name Type Description
Component ReactElement The component to pass theme to
Source:
See:
Example

Modified TextInput

import { TextInput } from 'oskari-ui';
import { ThemeConsumer } from 'oskari-ui/util';

const ColoredInput = ThemeConsumer(({ theme }) => (
    <TextInput style={{ background-color: theme.color.primary }}/>
));