Hacker News new | ask | show | jobs
by gcr 236 days ago
The OP is referring to the old days of javascript, where the UI was directed programatically and imperatively, e.g.

<div id="myoutput">Enter a name</div>

<input type="text" onchange="document.getElementById('myoutput').innerText = `Hello {name}!`" />

One upside of this approach is that the only subtree that needs to be re-rendered is the specific element whose state got mutated.

Another upside of this approach is that the code doing the mutation is very close to the actual UI element that triggered it. Of course, this rapidly turns into a downside as the size of the codebase grows...