Skip to content

Commit

Permalink
Merge pull request #588 from jbetancur/fix/558-linting
Browse files Browse the repository at this point in the history
fixes linting issues and useMemo props
  • Loading branch information
jbetancur authored May 28, 2020
2 parents fc69b51 + 05f2974 commit 44c82db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DataTable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const DataTable = memo(({
}, [paginationTotalRows]);

const columnsBySelector = useMemo(() => {
return columns.reduce((acc, item) => ({...acc, [item.selector]: item}), {})
return columns.reduce((acc, item) => ({ ...acc, [item.selector]: item }), {});
}, [columns]);

const sortedData = useMemo(() => {
Expand All @@ -209,7 +209,7 @@ const DataTable = memo(({
: (a, b) => column.sortFunction(a, b) * -1;

return [...data].sort(customSortFunction);
}, [data, columns, sortColumn, sortDirection, sortFunction, sortServer]);
}, [sortServer, sortColumn, columnsBySelector, sortDirection, data, sortFunction]);

const calculatedRows = useMemo(() => {
if (pagination && !paginationServer) {
Expand Down

0 comments on commit 44c82db

Please sign in to comment.