Skip to content

Commit

Permalink
fix: one more table sizing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhu021 committed May 30, 2024
1 parent b947424 commit e146aa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/admin/admin-table/admin-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,18 @@ export default function AdminTable() {
.then((reimbursements) => {
setReimbursements(reimbursements);
setIsLoading(false);
handleWindowResize();
})
.catch((err) => {
setError(err);
setIsLoading(false);
});
}, []);

React.useEffect(() => {
handleWindowResize();
window.addEventListener("resize", handleWindowResize);
return () => window.removeEventListener("resize", handleWindowResize);
}, []);
}, [reimbursements]);

const table = useReactTable({
data: reimbursements,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function DataTable<TData, TValue>({ columns, data }: DataTableProps<TData
handleWindowResize();
window.addEventListener("resize", handleWindowResize);
return () => window.removeEventListener("resize", handleWindowResize);
}, []);
}, [data]);

const table = useReactTable({
data,
Expand Down

0 comments on commit e146aa8

Please sign in to comment.