3 ms·
I wish you would start with this argument, instead of the one that looked very much like trolling. Can DOM be faster? Maybe so. Does that mean React is a bad i
by mynegation 11y ago
I wish you would start with this argument, instead of the one that looked very much like trolling.
Can DOM be faster? Maybe so. Does that mean React is a bad idea? No. In fact, React is Multiple Buffering[1] in the age of DOM. It is not that DOM is slow, it is that change of DOM triggers the layout and layout is inherently slow, because it is complex.
If you do not need re-layout on each DOM change (and most of the time you do not), React allows you to batch changes in a very clean way.
[1] https://en.wikipedia.org/wiki/Multiple_buffering https://en.wikipedia.org/wiki/Multiple_buffering
- deleted 11y ago[deleted]
- throwaway41597 11y agoThere isn't a relayout on each DOM change. Changes trigger layout when you read DOM properties such as clientWidth or when the event loop loops.