How can I create a style element and append to head in React?
问题 I'm currently learning React, and (more importantly) attempting to learn how react actually works. I have some generated css which I would like to append to head as a style element. In js land, this would be: const $style = document.createElement("style"); document.head.appendChild($style); const randBlue = ~~(Math.random() * 250); $style.innerHtml = `body { color: rgb(10, 10, ${randBlue}); }`; Unfortunately, in React land, things appear to be a little less straightforward in this regard. My