When attempting to retrieve sorted data from MatTableDataSource, I used the following code:
this.source = this.dataSource.sortData(this.dataSource.filteredData,this.dataSource.sort);
Unfortunately, I encountered an error message:
Argument of type 'MatSort | null' is not assignable to parameter of type 'MatSort'. Type 'null' is not assignable to type 'MatSort'
I am working with Angular 16.