title: How to include styles in React create portal
body: <p>I have ViewAllGraphs class:</p>
  <pre><code>import '../styles/Graph.css'
  export class ViewAllGraphs extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              showWindowPortal: false,
  }
  </code></pre>
  <p>And render method:</p>
  <pre><code>return (
              &lt;div&gt;
                  {
                      this.state.showWindowPortal &amp;&amp; (
                          &lt;Graph closeWindowPortal={this.closeWindowPortal} &gt;
                              &lt;h1&gt;Id графика : {this.state.currentId}&lt;/h1&gt;
                              &lt;h1&gt;Название графика : {this.state.currentTitle}&lt;/h1&gt;
                              &lt;img o src={`data:image/png;base64,${this.state.currentImage}`} /&gt;
                              &lt;h1&gt;Данные графика : {this.state.currentData}&lt;/h1&gt;
                              &lt;button className=&quot;graph-button-close&quot; onClick={() =&gt; this.closeWindowPortal()} &gt;
                                  Закрыть график
                          &lt;/button&gt;
                          &lt;/Graph&gt;
                      )
                  }
  &lt;/div&gt;
  </code></pre>
  <p>My CSS file is located in <code>../styles/Graph.css</code></p>
  <p>I want to style my graph component, for example, the button. This is code of this component:</p>
  <pre><code>import React from &quot;react&quot;;
  import ReactDOM from 'react-dom'
  import '../styles/Graph.css'
  
  class Graph extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              id: 0,
          }
          this.containerEl = null;
          this.externalWindow = null;
      }
      componentDidMount() {
          this.externalWindow = window.open('', '');
          this.containerEl = this.externalWindow.document.createElement('div');
          this.externalWindow.document.body.appendChild(this.containerEl);
          this.externalWindow.document.title = 'A React portal window';
          this.externalWindow.addEventListener('beforeunload', () =&gt; {
              this.props.closeWindowPortal();
          });
  
          this.shouldComponentUpdate();
          this.setState({
              id: 1,
          })
      }
      shouldComponentUpdate() {
          return true;
      }
  
      componentWillUnmount() {
          this.externalWindow.close();
      }
  
      render() {
          if (!this.containerEl) {
              return null;
          }
          else
              return ReactDOM.createPortal(this.props.children, this.containerEl);
      }
  };
  
  export default Graph
  </code></pre>
  <p>I am trying to include the CSS file and apply <code>className=&quot;graph-button-close&quot;</code> in render method to my button, but it's not working. Why can't I import the CSS file to graph class?</p>