'Ag grid react warning: State updates from the useState() and useReducer() Hooks don't support the second callback argument

I tried to make an app as simple as possible to make the error easier to understand so I just implemented it in the App.tsx.

import { AgGridReact } from "ag-grid-react";
...

function App() {
// I know these should be states or memos, but I wanted to be sure it was not that the problem, it happens // exactly the same using useState or useMemo
  const rowData = [
    {make: "Toyota", model: "Celica", price: 35000},
    {make: "Ford", model: "Mondeo", price: 32000},
    {make: "Porsche", model: "Boxter", price: 72000}
  ];
  const columnDefs = [
    {field: 'make'},
    {field: 'model'},
  ];


  return (
    <>
      <AgGridReact rowData={rowData} columnDefs={columnDefs} />
    </>
  );
}

export default App;

Only this code is giving me these warnings: Multiple warnings

Using the prop suppressReactUi does not throw these warnings, but it is legacy code, as noticed by another warning from aggrid.

What am I doing wrong? This happened after updating from version 19 and I thought it was something we were doing, thats the reason I tried to Isolate the problem in app.tsx.

First I tried changing the functions we were passing to the AgGridReact component but it was pointless.

Update: I debugged a bit and realised it is something related to the scroll: enter image description here

So it could probably be happening because of these hooks: enter image description here

Or these ones: enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source