frontend-collective / frontend-collective/react-sortable-tree

Attempting to dynamically assigning rowHeight, I got stuck

Open
#410 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

Long story short, I could do this:

1. After the SortableTree Component is rendered for the first time, measure the heights of the contents of nodes
2. Add a height property to the node objects in this.state.treeData array.
3. The rowHeight function takes the node as an argument and returns node.height

The problem here, however, is that the rowHeight function is called only during the first render. So changing the node.height after the first rendering has no meaning!

How can we solve this problem? I would appreciate it if you gave me a hint.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.