title: A spread argument must either have a tuple type or be passed to a rest parameter React
body: <p>I have this code in <code>Typescript</code>:</p>
  <pre class="lang-js prettyprint-override"><code>const [history, setHistory] = useState([Array(9).fill(null)]);
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>const newHistory = history.slice(0, currentStep + 1);
  </code></pre>
  <p>and when I want to set new State using spread operators like that:</p>
  <pre><code>setHistory(...newHistory);
  </code></pre>
  <p>I have errors:</p>
  <blockquote>
  <p>A spread argument must either have a tuple type or be passed to a rest parameter.</p>
  </blockquote>
  <p>Can someone can help my, how I can properly types this?</p>