Repository: facebook/react
File: packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js (JavaScript)

Code before:
        console.error(
          'React encountered a hoistable style tag for the same href as a preload: "%s". When using a style tag to inline styles you should not also preload it as a stylsheet.',
          href,
        );
      }
    }

    if (!styleQueue) {
      // This is the first time we've encountered this precedence we need
      // to create a StyleQueue.
      styleQueue = {
        start: renderState.startInlineStyle,
        precedence: stringToChunk(escapeTextForBrowser(precedence)),
        rules: ([]: Array<Chunk | PrecomputedChunk>),
        hrefs: ([]: Array<Chunk | PrecomputedChunk>),
        sheets: (new Map(): Map<string, StylesheetResource>),
      };
      renderState.styles.set(precedence, styleQueue);
    }

    const nonceStyle = renderState.nonce.style;
    if (!nonceStyle || nonceStyle === nonce) {
      if (__DEV__) {
        if (!nonceStyle && nonce) {
          console.error(
            'React encountered a hoistable style tag with "%s" nonce. The nonce was not passed to the render call though.',
            nonce,
          );
        }
      }
      styleQueue.hrefs.push(stringToChunk(escapeTextForBrowser(href)));
      pushStyleContents(styleQueue.rules, props);
    } else if (__DEV__) {
      console.error(
        'React encountered a hoistable style tag with "%s" nonce. It doesn\'t match the "%s" nonce passed to the render call. They have to be the same.',
        nonce,
        nonceStyle,
      );
    }
  }
  if (styleQueue) {
    // We need to track whether this boundary should wait on this resource or not.
    // Typically this resource should always exist since we either had it or just created
    // it. However, it's possible when you resume that the style has already been emitted
    // and then it wouldn't be recreated in the RenderState and there's no need to track
    // it again since we should've hoisted it to the shell already.
    if (hoistableState) {
      hoistableState.styles.add(styleQueue);
    }
  }


Review comment (suggestion):
We might need to be even clearer here with something like 
```suggestion
            'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include a nonce attributes if you also provide the same style nonce value as a render option.',
```

Code after:
      if (resourceState) {
        console.error(
          'React encountered a hoistable style tag for the same href as a preload: "%s". When using a style tag to inline styles you should not also preload it as a stylsheet.',
          href,
        );
      }
    }

    if (!styleQueue) {
      // This is the first time we've encountered this precedence we need
      // to create a StyleQueue.
      styleQueue = {
        precedence: stringToChunk(escapeTextForBrowser(precedence)),
        rules: ([]: Array<Chunk | PrecomputedChunk>),
        hrefs: ([]: Array<Chunk | PrecomputedChunk>),
        sheets: (new Map(): Map<string, StylesheetResource>),
      };
      renderState.styles.set(precedence, styleQueue);
    }

    const nonceStyle = renderState.nonce.style;
    if (!nonceStyle || nonceStyle === nonce) {
      if (__DEV__) {
        if (!nonceStyle && nonce) {
          console.error(
            'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include a nonce attributes if you also provide the same style nonce value as a render option.',
            precedence,
            nonce,
          );
        }
      }
      styleQueue.hrefs.push(stringToChunk(escapeTextForBrowser(href)));
      pushStyleContents(styleQueue.rules, props);
    } else if (__DEV__) {
      console.error(
        'React encountered a style tag with `precedence` "%s" and `nonce` "%s". When React manages style rules using `precedence` it will only include rules if the nonce matches the style nonce "%s" that was included with this render.',
        precedence,
        nonce,
        nonceStyle,
      );
    }
  }
  if (styleQueue) {
    // We need to track whether this boundary should wait on this resource or not.
    // Typically this resource should always exist since we either had it or just created
    // it. However, it's possible when you resume that the style has already been emitted
    // and then it wouldn't be recreated in the RenderState and there's no need to track
    // it again since we should've hoisted it to the shell already.
    if (hoistableState) {
      hoistableState.styles.add(styleQueue);
    }