Skip to content

[data grid] Missing functions {setRow, setRowModesModel} from GridToolbarProps TypeScript definition #15993

@pattrickrice

Description

@pattrickrice

Steps to reproduce

Steps:

  1. Open this link to live example: (required)
    declare module '@mui/x-data-grid' {
    interface ToolbarPropsOverrides {
    setRows: (newRows: (oldRows: GridRowsProp) => GridRowsProp) => void;
    setRowModesModel: (
    newModel: (oldModel: GridRowModesModel) => GridRowModesModel,
    ) => void;
    }
    }

Current behavior

GridToolbarProps is missing these two functions. If there's a reason the interface doesn't have them, it's not documented.

Expected behavior

I would expect to not have to declare these types myself. I would assume we should be able to add these to GridToolbarProps and remove the unnecessary complication of needing to have users extend the declaration.

Context

I'm trying to upgrade to v7 and encountered this as a typescript error and had to search through the docs thinking I was doing something wrong.

Your environment

npx @mui/envinfo
  System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
  Binaries:
    Node: 16.20.2 - /usr/bin/node
    npm: 8.19.4 - /usr/bin/npm
    pnpm: 8.15.6 - /usr/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.108

Search keywords: data-grid

Order ID:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions