I tried to render a Link component inside the MUI data-grid cell, my code is as below:
import { GridColDef } from "@mui/x-data-grid";
import { Link } from "react-router-dom";
const myColumns: GridColDef[] = [
{ field: "id", headerName: "ID", width: 70 },
{
field: "prLink",
headerName: "PR Link",
width: 150,
renderCell: (params) => <Link to={params.value} >{params.value}</Link>,
},
{
field: "needExtraCost",
headerName: "Need E/Cost",
width: 120,
},
];
export {
extraCostColumns
}
And I get error like below:
ERROR in src/app/models/extra-cost.ts:64:12 TS1005: ';' expected.
It's from the renderCell call, when I remove the line, it's back to normal, I followed the MUI document, is there anything I doing wrong? please advice, thanks.