Delete selected rows in dash datatable in callback

I have a dash datatable. I select rows in the table. I have a button to delete the selected rows. In my callback, I update my database, I remove the selected rows from the data and return the updated data. I am getting a javascript error “t is null”.
Is deleting datatable rows in a callback and returning the updated data something that is supposed to be able to do?

I figured it out. After deleting the selected rows, I was setting selected rows to None and returning it. When I set selected rows to empty list and returning it then it worked.