How to use the jss.constructor function in jss

To help you get started, we’ve selected a few jss examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cssinjs / jss / packages / react-jss / src / JssProvider.js View on Github external
jss?: Jss,
  registry?: SheetsRegistry,
  generateId?: GenerateId,
  classNamePrefix?: string,
  disableStylesGeneration?: boolean,
  media?: string,
  id?: CreateGenerateIdOptions,
  children: Node
|}

const initialContext: Object = {}

export default class JssProvider extends Component {
  static propTypes = {
    registry: PropTypes.instanceOf(SheetsRegistry),
    jss: PropTypes.instanceOf(defaultJss.constructor),
    generateId: PropTypes.func,
    classNamePrefix: PropTypes.string,
    disableStylesGeneration: PropTypes.bool,
    children: PropTypes.node.isRequired,
    media: PropTypes.string,
    id: PropTypes.shape({minify: PropTypes.bool})
  }

  managers: Managers = {}

  createContext = (parentContext: Context, prevContext?: Context = initialContext) => {
    const {
      registry,
      classNamePrefix,
      jss,
      generateId,