React add styling to element

In normal javascript you can grab an element by its id and add a style to it. For example:

var element = document.getElementById("myElement");
element.style.backgroundColor = "#f5f5f5";

My question is how you can do this in react. Is it even possible to add this style?
Also if you can do it to an html5 canvas element.

104 thoughts on “React add styling to element”

  1. Hi there very cool blog!! Man .. Beautiful .. Amazing ..
    I will bookmark your web site and take the feeds additionally?
    I’m happy to seek out so many helpful info right here within the publish, we want develop extra strategies
    on this regard, thank you for sharing. . . . .
    .

    Reply
  2. Hmm is anyone else encountering problems with the pictures on this blog loading?
    I’m trying to determine if its a problem on my end or if it’s the blog.

    Any responses would be greatly appreciated.

    Reply
  3. Hello there, just became alert to your blog through Google, and
    found that it’s truly informative. I’m gonna watch out for brussels.
    I will appreciate if you continue this in future. Numerous people will be benefited from
    your writing. Cheers!

    Reply
  4. I love your blog.. very nice colors & theme. Did you make this website yourself
    or did you hire someone to do it for you?
    Plz reply as I’m looking to construct my own blog and would like to find out where u got this from.
    thanks a lot

    Reply
  5. The other day, while I was at work, my sister stole my iPad and tested to
    see if it can survive a forty foot drop, just so she can be a youtube sensation. My iPad
    is now destroyed and she has 83 views. I know this
    is totally off topic but I had to share it with someone!
    quest bars http://bit.ly/3C2tkMR quest bars

    Reply
  6. Please let me know if you’re looking for a article writer for
    your site. You have some really good articles and I feel I would be a good asset.
    If you ever want to take some of the load off, I’d absolutely
    love to write some content for your blog in exchange for a link back to mine.
    Please send me an e-mail if interested. Thanks!

    Reply

Leave a Comment