|
|
|
|
|
by onion2k
2 hours ago
|
|
React doesn't do anything unless the DOM needs to to be updated. Arguably React does have a 'disadvantage' in the sense that it doesn't do two-way data binding, and chooses to update as little of the DOM as necessary to render a change (which it's good at, and gets right), but that's sometimes more than just changing a text node or a value. I suspect that if React hadn't come along there'd be lots of homegrown frameworks doing something similar in a worse way. React is well thought-out and well designed. Also, every reactive framework can have the same problem. It's not a React thing; it's a library-that-tracks-changes-and-updates-the-DOM thing. Used poorly you'll end up in a re-render loop. We could just have static HTML pages and that would eliminate the whole problem, but then we'd be complaining about the electricity used on network roundtrips and people using badly coded desktop apps instead. Ultimately, libraries can be as bulletproof and fool-proof as you like, and developers will find new and novel ways to use them to build crap software. The responsibility (mostly) lies with the developers much more than the library. |
|