Skip to content

Commit

Permalink
Add "nested-update" phase to profiler typings
Browse files Browse the repository at this point in the history
"nested-update" added in facebook/react#20163
  • Loading branch information
shlensky committed Jan 25, 2023
1 parent 79f5007 commit fe139b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/docs/reference-profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit fe139b7

Please sign in to comment.