I am using AgGrid(31.2.1) with TypeScript(4.3.5) and React, and I would like to use valueGetter
to display my values. The problem arises because the TypeScript doesn’t pick up the data type of the params
and returns it as any.
I am trying to define my column as follows:
interface ICar {
make: string;
model: string;
price: number;
}
const colDef: AgGrid.ColDef<ICar> = {
headerName: "Make",
valueGetter: params => params.data.make
};
The problems is that params
is recognized as any, and I would like it to be of type ValueGetterFunc<ICar>
. Is this possible to do without explicitly writing the data type of the params
.
user24770756 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.