glittershark/reactable

defaultSort doesn't update on componentWillReceiveProps

michellethomas opened this issue · 0 comments

I'm noticing a problem, when I update the defaultSort and pass in a new column without refreshing the page the component doesn't update to sort on the new column.

In componentWillReceiveProps updateCurrentSort takes nextProps.sortBy instead of nextProps.defaultSort. defaultSort doesn't get updated outside of the constructor.

The README only mentions defaultSort, is there a reason for having both defaultSort and sortBy as props?

Even when I use sortBy the table doesn't correctly sort by the new column. Maybe setState here should be a functional set state?