reactjs - How to highlight only selected row in a large table set in React? -


i'm working on table component react , i'm encountering issue large table set (> 500 rows). indeed, when try highlight row clicked on, encounter big leak in performances.

in order achieve row selection, i'm holding state containing active row in top component consists of container rows in table. when click on cell, i'm updating state row cell part of.

this cause trigger of render() method top component , whole application becomes slow due huge amount of elements re-rendered.

how can re-render selected row? there general best-practice avoid re-render of components under top component?

enter image description here

what using css? can use :hover property on each row , change background color each time mouse on or clicked. performance stress low if use css property.

good luck


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -