←back to thread

218 points mdhb | 1 comments | | HN request time: 0s | source
Show context
upghost ◴[] No.44393571[source]
Is there anyone else who feels kinda like declarative templating is actually kind of worse than jQuery? Don't get me wrong, I've been using React for nearly a decade. But the more complex my SPAs become, the more I wish I had imperative control of the DOM.

I think the reason is because the DOM is a leaky abstraction and at some level I would just prefer last write wins.

I realize declarative templating is supposed to handle that, but this starts to break down really quickly when you share mutable state between components.

replies(3): >>44393652 #>>44396262 #>>44401772 #
1. parhamn ◴[] No.44393652[source]
I think part of this is React folks think its a cardinal sin to invoke the dom apis directly. Sometimes it's just fine to capture a ref (and dare I say, query a component by a id) and do the work directly. In fact this is what most libraries that are "fast" and low-rerenders do (like the form ones).