RendererContext

RendererContext is the internal instance of React.createContext that is provided by the new Context API. It is exposed to be used with React's new useContext API.

Note: Although it is exposed for react-fela as well as preact-fela and inferno-fela, there are no useContext equivalents for the latter yet.

Imports

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

Example

import { useContext } from 'react'
import { RendererContext } from 'react-fela'

function Button() {
  const renderer = useContext(RendererContext)
  // do something with the renderer
}

results matching ""

    No results matching ""