FelaTheme

FelaTheme is an alternative component to the withTheme-HoC leveraging the render-props pattern. It is used to access the theme object that is specified and passed down via context by a ThemeProvider.

Props

Property Type Description
children Function A render function that receives the theme object as its first parameter.

Deprecated Props

The following props are deprecated and will be removed in the next major version (11.0.0).

Property Type Description
render Function Works the same as children above

Imports

import { FelaTheme } from 'react-fela'
import { FelaTheme } from 'preact-fela'
import { FelaTheme } from 'inferno-fela'

Example

<FelaTheme>
  {theme => (
    <div>Primary color is ${theme.primary}.</div>
  )}
</FelaTheme>

results matching ""

    No results matching ""