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

Question: Why does whole tree re-renders on node modify?

Open
#373 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
5k
Forks
914
PR merge metrics
No merged PRs in 30d

Description

Hi,

First of all, thanks for the awesome component. I've looked at various React trees and this one is the best for my needs.

My tree nodes have modifiable title very similar to the one in the storybook. Using React Dev Tools, I see that the whole tree seems to be re-rendered on each keystroke editing the title (i.e. each onChange of the text Input element). Is expected behavior? What is the reason for this? Due to this, I feel compelled to use an uncontrolled form input and update the tree only on onSubmit and onBlur events. Would making nodes PureComponent prevent the re-render? If so, would this mean using nodeContentRenderer to override NodeRendererDefault?

Thanks.

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.