I'm trying to make a theme selector in React. But when I use 

```js
document.getElementsByClassName[0].style.setProperty("display", "none");

```

to make the element disappear, it returns

`TypeError: Cannot read property 'setProperty' of undefined`.

Is there a way to fix this error or another way to make the element vanish? Thanks in advance.