From fe139b7fe77bc73ca0e3c9332d11e84ab81a68c1 Mon Sep 17 00:00:00 2001 From: Dmitry Shlensky Date: Wed, 25 Jan 2023 10:04:24 +0300 Subject: [PATCH] Add "nested-update" phase to profiler typings "nested-update" added in https://github.com/facebook/react/pull/20163 --- content/docs/reference-profiler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/reference-profiler.md b/content/docs/reference-profiler.md index e361f7fa4f3..f235f1fd457 100644 --- a/content/docs/reference-profiler.md +++ b/content/docs/reference-profiler.md @@ -79,7 +79,7 @@ It receives parameters describing what was rendered and how long it took. ```js function onRenderCallback( id, // the "id" prop of the Profiler tree that has just committed - phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered) + phase, // either "mount" (if the tree just mounted) or "update" | "nested-update" (if it re-rendered) actualDuration, // time spent rendering the committed update baseDuration, // estimated time to render the entire subtree without memoization startTime, // when React began rendering this update @@ -95,7 +95,7 @@ Let's take a closer look at each of the props: * **`id: string`** - The `id` prop of the `Profiler` tree that has just committed. This can be used to identify which part of the tree was committed if you are using multiple profilers. -* **`phase: "mount" | "update"`** - +* **`phase: "mount" | "update" | "nested-update"`** - Identifies whether the tree has just been mounted for the first time or re-rendered due to a change in props, state, or hooks. * **`actualDuration: number`** - Time spent rendering the `Profiler` and its descendants for the current update.