Consuming Selected Theme
BlueBase exports a ThemeConsumer
component to utilise current theme. This is a render prop component, which means it takes a function as a child. The function gets an object in the param with the following interface:
Usage
The following snippet illustrates how to use a ThemeConsumer
Β component.
Example: ThemePicker
The following example shows how to use ThemeConsumer
component to create a theme picker. This renders a picker component with a list of all installed themes. It not only uses the current theme to style itself, but also utilises the changeTheme
Β method to switch themes.
Last updated