From 36ec2d77035f1fb32f1c52883c500e2c8e4b1324 Mon Sep 17 00:00:00 2001 From: Bilal Shafi Date: Wed, 7 Aug 2024 14:16:59 +0500 Subject: [PATCH] [docs] Add a warning to promote the usage of `updateRows` (#14027) --- docs/data/data-grid/row-updates/row-updates.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/data/data-grid/row-updates/row-updates.md b/docs/data/data-grid/row-updates/row-updates.md index e1b8e9680284..8b32b73b6fd1 100644 --- a/docs/data/data-grid/row-updates/row-updates.md +++ b/docs/data/data-grid/row-updates/row-updates.md @@ -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.