StyletronProvider

StyletronProvider

Source:
Properties:
Name Type Description
styletron object

Styletron instance

children ReactElement

children

Provides a Styletron instance to descendant styled components via context

Example
const Styletron = require('styletron');

function render() {
  return React.renderToString(
    <StyletronProvider styletron={new Styletron()}>
      <App/>
    </StyletronProvider>
  );
}

Extends

  • ReactClass

StyletronProvider

new StyletronProvider()

Source:
Properties:
Name Type Description
styletron object

Styletron instance

children PreactElement

children

Provides a Styletron instance to descendant styled components via context

Example
const Styletron = require('styletron');
const renderToString = require('preact-render-to-string');

function render() {
  return renderToString(
    <StyletronProvider styletron={new Styletron()}>
      <App/>
    </StyletronProvider>
  );
}

Extends

  • PreactClass