How to use the @emotion/sheet.DynamicStyleSheet function in @emotion/sheet

To help you get started, we’ve selected a few @emotion/sheet 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 emotion-js / next / packages / dynamic / src / index.js View on Github external
renderChild = (context: CSSContextType) => {
    const { css } = this.props
    const serialized = serializeStyles([css])
    const rules = context.stylis(`.css-${serialized.name}`, serialized.styles)
    if (this.sheet === undefined && isBrowser) {
      this.sheet = new DynamicStyleSheet(StyleSheetOptions)
      this.sheet.inject()
    }
    if (isBrowser) {
      this.sheet.insertRules(rules)
    }

    const child = this.props.render(serialized.cls)
    if (shouldSerializeToReactTree && rules.length !== 0) {
      return (

@emotion/sheet

emotion's stylesheet

MIT
Latest version published 4 months ago

Package Health Score

83 / 100
Full package analysis