Undefined of reading isDestroyed

Tags: #<Tag:0x00007efc6d2c0978> #<Tag:0x00007efc6d2c0338>

@Component({

})
export class MyComponent implements OnChanges {
@Input() settings;

private hotRegisterer = new HotTableRegisterer();

previewTableSettings: Handsontable.GridSettings = {
width: "100%",
height: 600,
mergeCells: [],
rowHeaders: true,
colHeaders: false,
comments: true,
fixedRowsTop: this.headerCount,
autoRowSize: true,
nestedHeaders: [],
minSpareRows: 0,
minSpareCols: 0,
manualColumnResize: [],
cells: (row, col) => {
  ....
  return cellProperties;
},
licenseKey: "non-commercial-and-evaluation",

};

ngOnChanges(changes) {
if (changes[“settings”] && this.settings) {
this.previewTableSettings.fixedColumnsLeft = this.settings.columnLeft;

  this.hotRegisterer.registerInstance(this.previewTableId, null);

  const hot = this.hotRegisterer.getInstance(this.previewTableId);
  if (hot) {
    hot.updateSettings(this.previewTableSettings);
  }
}

}
}

@NgModule({
declarations: [MyComponent],
imports: [HotTableModule]
})
export class MyModule

@NgModule({
declarations: […],
imports: [
…,
HotTableModule
]
})
export class AppModule

I don’t understand why i got error when i try getInstance of hotTableRegister. Error is:
TypeError: Cannot read properties of undefined (reading ‘isDestroyed’)
at HotTableRegisterer.getInstance (handsontable-angular.js:11:25)

But in second place all is the same and it works;)
Any tips maybe can help

@handsontable/angular”: “^13.0.0”

found decision. I added setTimeout and all is work

Thank you for the update.

I am glad that the issue is solved.