Skip to content

Choose a tag to compare

@Tylerian Tylerian released this 17 Oct 15:32
· 20 commits to master since this release
  • Rewrite of the context API:

Example of use:

import {
  StyletronConsumer,
  StyletronProvider
} from "styletron-react-lite";

const styletronEngine = new ...

<StyletronProvider engine={styletronEngine}>
  <YourComponentTree />
</StyletronProvider>

[...]

<StyletronConsumer>
{
  (engine) => (
    <SomeEngineDependantComponent engine={engine} />
  )
}
</StyletronConsumer>