mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
updating the informations needed when adding a root node to a tree in react-devtools overview doc (#19979)
Co-authored-by: Idriss AITHAFID <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Idriss AITHAFID
parent
67ed2649ea
commit
4c53d9f7f6
@@ -49,20 +49,22 @@ Later operations will reference strings by a one-based index. For example, `1` w
|
||||
|
||||
#### Adding a root node
|
||||
|
||||
Adding a root to the tree requires sending 4 numbers:
|
||||
Adding a root to the tree requires sending 5 numbers:
|
||||
|
||||
1. add operation constant (`1`)
|
||||
1. fiber id
|
||||
1. element type constant (`8 === ElementTypeRoot`)
|
||||
1. element type constant (`11 === ElementTypeRoot`)
|
||||
1. profiling supported flag
|
||||
1. owner metadata flag
|
||||
|
||||
For example, adding a root fiber with an id of 1:
|
||||
```js
|
||||
[
|
||||
1, // add operation
|
||||
1, // fiber id
|
||||
8, // ElementTypeRoot
|
||||
11, // ElementTypeRoot
|
||||
1, // this root's renderer supports profiling
|
||||
1, // this root has owner metadata
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user