3 ms·
> Can anybody offer a friendly explanation to me as to why it's not wise to update the DOM directly? Sure! The fundamental problem that React solves is turnin
by kansface 6y ago
> Can anybody offer a friendly explanation to me as to why it's not wise to update the DOM directly?
Sure! The fundamental problem that React solves is turning some canonical notion of state into the DOM (with an eye on composability). This is the central problem of web dev. Once your application grows large enough, you will inevitably end up re-implementing a much worse, ad-hoc solution out of $ or innerHTML. You will build your own React and will be responsible for maintaining it! If the scope of your app is small any solution OK.
I'm speaking from experience: I have built several Reacts over a decade or so - so before it existing and a few afterwards.