Skip to content

Commit 3bdd522

Browse files
committed
docs: ✏️ updated renderer docs
update in renderer docs to include style and measure property description
1 parent 3d6bfa1 commit 3bdd522

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

demo/src/docs/renderers.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
# Renderers
2+
23
A renderer is a component you can use to build your tree stucture. The power of it is that you can either use the renderers shipped with this package or you can create your own! A few examples on how to achieve it can be found at the examples section.
34

45
## Injected props
5-
| Name | Type | Description |
6-
| ------------- | ------------- | ----------- |
7-
| onChange | ({ node: Node *, type: UPDATE_TYPE *}) => void | to be invoked with the updated node and the update type |
8-
| node | Node * | The node being rendered for that row, with some additional info|
9-
| children | JSX | Anything your render as children of the component when using it|
106

11-
* Node = {
7+
| Name | Type | Description |
8+
| -------- | ---------------------------------------------- | ------------------------------------------------------------------------------------- |
9+
| onChange | ({ node: Node _, type: UPDATE_TYPE _}) => void | to be invoked with the updated node and the update type |
10+
| node | Node \* | The node being rendered for that row, with some additional info |
11+
| children | JSX | Anything your render as children of the component when using it |
12+
| style | React.CSSProperties | A opt in style property that will auto align your items and apply some default styles |
13+
| measure | () => void | A function that can be used to let the tree know about your node measurements |
14+
15+
- Node = {
1216
id: number
1317
name: string,
1418
state: object,
1519
deepness: number,
1620
parents: number[]
17-
}
18-
* UPDATE_TYPE = {
21+
}
22+
- UPDATE_TYPE = {
1923
ADD: 0,
2024
DELETE: 1,
2125
UPDATE: 2
22-
}
26+
}

0 commit comments

Comments
 (0)