Я не могу найти тип объекта «история» в классе, с «any []» проблем нет, но я предпочитаю избегать его использования и иметь хороший набор текста.
interface GameClass{
history: any[] ////////////Here
stepNumber:number
xIsNext:boolean
}
class Game extends React.Component<GameProps,GameClass>{
constructor(props:GameProps) {
super(props);
this.state = {
history: [{ squares: Array(9).fill(null) }], ////////////Here
stepNumber: 0,
xIsNext: true
};
}
}
CodePen
Спасибо