Link: https://codepen.io/LouisPetrich/pen/jOWYJeZ
In the javascript, I have an array of strings (hex codes), and I have a component with a method that assigns one of these strings to the state. I don’t know how to use that state to change the CSS.
-
I tried to change the CSS with in-line styles, but that didn’t work. I don’t know why!
-
I tried using
document.getElementById("mount-node").style.backgroundColor = . . .
but I don’t know how to use that dynamically
I would very much appreciate any guidance here. This is my first project working with html, javascript, and react together. I understand them individually, but those three separate windows at the top of codepen confuse me!