Skip to content

Commit

Permalink
fix: correct types in DataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
thraizz committed Dec 17, 2023
1 parent b4487ef commit 438cb7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import "ag-grid-community/styles/ag-theme-quartz.css"; // Theme
import { AgGridReact } from "ag-grid-react/lib/agGridReact";
import { useContext, useEffect, useState } from "react";
import { SessionContext } from "./SessionContext";
import { AveragedSwing } from "./calculateAverages";
import { getAllDataFromSession } from "./getAllDataFromSession";
import { GolfSwingData } from "./types/GolfSwingData";

export const DataTable = () => {
const { sessions } = useContext(SessionContext);

// Column Definitions: Defines & controls grid columns.
const [columnDefs, setColumnDefs] = useState<ColDef<AveragedSwing>[]>([]);
const [columnDefs, setColumnDefs] = useState<ColDef<GolfSwingData>[]>([]);

useEffect(() => {
if (sessions && Object.keys(sessions)?.length > 0) {
Expand All @@ -25,7 +25,7 @@ export const DataTable = () => {
sortable: true,
filter: true,
}));
setColumnDefs(columns as ColDef<AveragedSwing>[]);
setColumnDefs(columns as ColDef<GolfSwingData>[]);
}
}, [sessions]);

Expand Down

0 comments on commit 438cb7e

Please sign in to comment.