Skip to content

Commit

Permalink
[docs] Add a warning to promote the usage of updateRows (#14027)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored Aug 7, 2024
1 parent 9e59066 commit 36ec2d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/data/data-grid/row-updates/row-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ It replaces the previous values. This approach has some drawbacks:

{{"demo": "UpdateRowsProp.js", "bg": "inline"}}

:::warning
Updating the `rows` prop causes the Data Grid to recompute the row tree, resulting in losing the current tree information like the expanded rows state.
Unless the recomputation is explicitly required, the API method `updateRows` should be used.
:::

## The `updateRows` method

If you want to only update part of the rows, you can use the `apiRef.current.updateRows` method.
Expand Down

0 comments on commit 36ec2d7

Please sign in to comment.