Use onSortByPropChange to be passed to the useImperativeHandle and keep onSortChange as it is. This is because, if we change onSortChange, then it will be a breaking change.
I tried a different approach to use a hook outside of DatatableWrapper, but the changes were quite big and of course, breaking. I don't want to make the table API unstable, so I'll leave it for the future.
This follows the idea in https://github.com/imballinst/react-bs-datatable/pull/123#issuecomment-1050421625, with 1 change:
onSortByPropChange
to be passed to theuseImperativeHandle
and keeponSortChange
as it is. This is because, if we changeonSortChange
, then it will be a breaking change.I tried a different approach to use a hook outside of
DatatableWrapper
, but the changes were quite big and of course, breaking. I don't want to make the table API unstable, so I'll leave it for the future.Signed-off-by: Try Ajitiono ballinst@gmail.com