React JS and shouldComponentUpdate based


I am using React JS to create a grid system. I need to replicate the freeze column and freeze row feature in it. I have successfully implemented the freeze column feature, but I get the cells re-rendered when the freeze changes. Details:

I have a component which renders two table elements. First table has 3 columns, second table has 2 columns. Once the component state changes, the last two columns of my 1st table move onto the first two positions in the second table, thus having 1st table with 1 column and 2nd table with 4 columns.

For rendering the cells I have created a Cell component. I have added the sholdComponentUpdate method to return false always, but the cells keep getting re-rendered.

I am looking to find out whether there is a way I can avoid re-rendering the cells, considering they get moved between elements, thus different tree noes.

Also, based on your opinion, is it faster if they get moved and avoid re-rendering? If yes, then I can code this functionality in Vanilla JS and insert the cells in the appropriate positions.

For row freezing, would be moving the rows completely.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.