79264901

Date: 2024-12-09 12:07:27
Score: 1.5
Natty:
Report link

Try using apiRef to dynamically change data in the table, without rerendering.

https://mui.com/x/react-data-grid/api-object/

function browser({params}) {
  const apiRef = useGridApiRef();

  return (
    <div>
      <Button 
          onClick={() => apiRef.current.setRows([{ id: 1, name: 'John' }])}
      >
          Add row
      </Button>
      <DataGrid columns={columns} apiRef={apiRef} {...other} />
    </div>
  );
}
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: beloyar