React AG Grid: cellRendererFactory disappears when moving to v25

Viewed 66

I'm attempting to upgrade Ag Grid from v24 to v25. There's been an an undocumented removal of the cellRendererFactory component of the grid api; it just disappeared.

I rely on that function in the following code, to see what the autoHeightCalculator would've calculated as the height for my rows:

const getRowHeight = ({ node, data, api, context }) => {
    const pixelsPerEvent = 24;
    const numEventsByClass = entityClass.map(ec => Object.keys(data).includes(ec.name) ? data[ec.name].length : 0);
    const maxEventsInCell = Math.max(...numEventsByClass, 1);
// This line uses the missing API function
    const autoHeightValue = api.cellRendererFactory.gridOptionsWrapper.autoHeightCalculator.getPreferredHeightForRow(node);
    return Math.max(maxEventsInCell * pixelsPerEvent, autoHeightValue);
}

Is there a new feature that I should use to replace this?

0 Answers
Related