3 ms·
Nice! Looks really polished! One thing I'm wondering about... if this is React based, do you reassign and recalculate the whole grid upon every change? Becaus
by captainmuon 10y ago
Nice! Looks really polished!
One thing I'm wondering about... if this is React based, do you reassign and recalculate the whole grid upon every change? Because the grid is probably a component, and has the table as props. I could imagine that is inefficient... Not to even speak of then rendering the whole component and sending it through DOM reconciliation every time a key is pressed.
Well, OTOH I guess it doesn't matter for small tables. The demo feels really snappy!
- ChicagoBoy11 10y agoWouldn't it just re-render the cells that changed?
- netzone 10y agoYup, checking the source there's a cell component in addition to the sheet component, so it would just rerender that cell.
- prodtorok 10y agoI've built something similar (and performant) utilizing react-virtualized, Immutable.js, and the star: shouldComponentUpdate https://bvaughn.github.io/react-virtualized/#/components/Grid https://bvaughn.github.io/react-virtualized/#/components/Gri...
- nadimisl 10y agoIt calculates the top level grid component but does not render the cell if it's the same cell object :).
- huherto 10y agoBack in the day I did a perl spread sheet. I was only updating the cells that were displayed at the moment. There were also transitive recalcs too if a displayed cell depended on other cells.