Harsh P
Harsh P

Reputation: 1

Primereact treetable is very slow with large datasets

We are using primereact treetable (https://primereact.org/treetable/) library for rendering table rows in a tree. There are around 400 rows where around 40 are at root level while others are nested inside. Each table row has some text input controls.

We have list of nodes which we maintain in a react state. Each node's "data" object has properties corresponding to which we have the input controls. When user types in the input we update the specific node in the list and update the react state. But this works very slow when all the nodes are in expanded state. Even the actions like collapse/expand are slow thereafter.

Has anyone experienced similar problem or have any solution to optimize this?

I found that virtual scrolling (i.e. loading only the nodes visible in viewport) might solve this but the support for this does not seem to be available in the library so if anyone can guide me how to implement this would be great!

I am ensuring that when the input is modified then only that specific node is updated in the state so that other nodes are immutable and hence react should not render the entire list in the state.

Upvotes: 0

Views: 68

Answers (0)

Related Questions