React Markdown Previewer app, css class values ignored?

Perhaps I forgot something about how React components behave, but I noticed that even though I specified class=“editor”, my height and width values for the “editor” class are ignored. The same values put into textarea allow my React component to properly size itself. Why is this happening?

My css file:

body {
    background-color: #334;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

.editor {
  height: 300px;
  width: 500px;

.preview {
  border: 10px solid black;
  background-color: white;
  height: 300px;
  width: 300px;

textarea {
  height: 300px;
  width: 500px;

And here are the components defined in my render function:

return (<div>
        <textarea id="editor" class="editor" value={this.state.input} onChange={this.handleChange} />
        <div id="preview" class="preview" dangerouslySetInnerHTML={inner}></div>

It seems as both “editor” and “preview” class names are not getting values from my css file.

Because class is a reserved work in JS, React can’t use that word. In React, you use className in your JSX.

Similarly, where you would use for in html, you have to use htmlFor in JSX.

<face palm>
Thank you.