title: react-chart2: giving me Cannot read properties of undefined (reading 'map')
body: <p>I am trying to use <code>react-chartjs-2</code> in my project to create a chart and I am getting the following error:</p>
  <pre><code>TypeError: Cannot read properties of undefined (reading 'map')
  setDatasets
  C:/Users/vivek/code/src/utils.ts:46
    43 |   currentData: ChartData&lt;TType, TData, TLabel&gt;,
    44 |   nextDatasets: ChartDataset&lt;TType, TData&gt;[]
    45 | ) {
  &gt; 46 |   currentData.datasets = nextDatasets.map(nextDataset =&gt; {
    47 |     // given the new set, find it's current match
    48 |     const currentDataset = currentData.datasets.find(
    49 |       dataset =&gt;
  </code></pre>
  <p>And, this is my code:</p>
  <pre><code>import React from &quot;react&quot;;
  import { Bar } from &quot;react-chartjs-2&quot;;
  
  const BarChart = () =&gt; {
    return (
      &lt;div&gt;
        &lt;Bar
          data={{
            labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
          }}
          width={600}
          height={400}
          options={{ maintainAspectRatio: false }}
        /&gt;
      &lt;/div&gt;
    );
  };
  export default BarChart;
  </code></pre>
  <p>I am trying to create a bar chart</p>