here is my code
lass TableHeader extends Component {
raiseSort = path => {
const sortColumn = { ...this.props.sortColumn };
if (sortColumn.path === path)
sortColumn.order = sortColumn.order === "asc" ? "desc" : "asc";
else {
sortColumn.path = path;
sortColumn.order = "asc";
}
this.props.onSort(sortColumn);
};
class Movies extends Component {
state = {
movies:[],
deleted: [],
genres:[],
pageSize: 4,
currentPage:1,
sortColumn: { path: "title", order: "asc" }
};
handleSort = sortColumn => {
this.setState({ sortColumn });
};
const sorted = _.orderBy(filtered, [sortColumn.path], [sortColumn.order]);
const movies = paginate(sorted,currentPage,pageSize)