I have this code in Typescript
:
const [history, setHistory] = useState([Array(9).fill(null)]);
const newHistory = history.slice(0, currentStep + 1);
and when I want to set new State using spread operators like that:
setHistory(...newHistory);
I have errors:
A spread argument must either have a tuple type or be passed to a rest parameter.
Can someone can help my, how I can properly types this?