RendererProvider
RendererProvider is used to pass the Fela renderer down to all your child components. It uses React's context(new tab) APIs to do so. It actually is all you need to fully use Fela within your application.
Props
Property | Type | Description |
---|---|---|
renderer | Renderer | The Fela renderer which is used to actually render our styles. |
targetDocument | Document(new tab)? | Document in which's head the styles are injected. |
Imports
import { RendererProvider } from 'react-fela'import { RendererProvider } from 'preact-fela'import { RendererProvider } from 'inferno-fela'
Example
import { createRenderer } from 'fela'
const renderer = createRenderer()
// Wrap your root application with the RendererProvider// to pass down the renderer to every component using contextconst Usage = ( <RendererProvider renderer={renderer}> <App /> </RendererProvider>)