3 ms·
Adding on to what acemarke said, with which I agree: Defining a mapping of your table data elements to virtual DOM elements allows React to update only the row
by eschutte2 8y ago
Adding on to what acemarke said, with which I agree:
Defining a mapping of your table data elements to virtual DOM elements allows React to update only the rows that changed, automatically (from your perspective), which is much faster than messing with the DOM for all rows. Yes, you can do the diffing yourself, at which point you would have rewritten a lot of React.
You mentioned the button example a few times. A normal button in React shouldn't be any more code than doing it in vanilla JavaScript. All those projects with Button.jsx are doing that because they've decided they want to add behavior to a normal HTML button, and they want it consistent throughout their app.
W.r.t. debugging, I meant just reading code, but yes the tooling is very nice too.