title: Next.js: window is not defined
body: <p>I'm trying to use apexcharts for a next.js application and it's returning me window is not defined.</p>
  <p>I would love any help with that.</p>
  <p>Does someone know what is happening and why?</p>
  <pre><code>import React from 'react';
  import Chart from 'react-apexcharts';
  
  export default class Graficos extends React.Component &lt;{}, { options: any, series: any }&gt; {
      constructor(props:any) {
          super(props);
  
          this.state = {
              options: {
              chart: {
                  id: &quot;basic-bar&quot;
              },
              xaxis: {
                  categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
              }
              },
              series: [
              {
                  name: &quot;series-1&quot;,
                  data: [30, 40, 45, 50, 49, 60, 70, 91]
              }
              ]
          };
      }
    
      render() {
          return (
              &lt;div className=&quot;row&quot;&gt;
                  &lt;h1&gt;Gráfico Básico&lt;/h1&gt;
                  &lt;div className=&quot;mixed-chart&quot;&gt;
                      &lt;Chart
                          options={this.state.options}
                          series={this.state.series}
                          type=&quot;bar&quot;
                          width={500}
                      /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          );
      }
    }
  </code></pre>