-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update in renderer docs to include style and measure property description
- Loading branch information
1 parent
3d6bfa1
commit 3bdd522
Showing
1 changed file
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
# Renderers | ||
|
||
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. | ||
|
||
## Injected props | ||
| Name | Type | Description | | ||
| ------------- | ------------- | ----------- | | ||
| onChange | ({ node: Node *, type: UPDATE_TYPE *}) => void | to be invoked with the updated node and the update type | | ||
| node | Node * | The node being rendered for that row, with some additional info| | ||
| children | JSX | Anything your render as children of the component when using it| | ||
|
||
* Node = { | ||
| Name | Type | Description | | ||
| -------- | ---------------------------------------------- | ------------------------------------------------------------------------------------- | | ||
| onChange | ({ node: Node _, type: UPDATE_TYPE _}) => void | to be invoked with the updated node and the update type | | ||
| node | Node \* | The node being rendered for that row, with some additional info | | ||
| children | JSX | Anything your render as children of the component when using it | | ||
| style | React.CSSProperties | A opt in style property that will auto align your items and apply some default styles | | ||
| measure | () => void | A function that can be used to let the tree know about your node measurements | | ||
|
||
- Node = { | ||
id: number | ||
name: string, | ||
state: object, | ||
deepness: number, | ||
parents: number[] | ||
} | ||
* UPDATE_TYPE = { | ||
} | ||
- UPDATE_TYPE = { | ||
ADD: 0, | ||
DELETE: 1, | ||
UPDATE: 2 | ||
} | ||
} |