13 ms·
The fundamental problem with React and the like, is that it forced developers to unlearn the anchor tag. If you can change the url via js why use an actual hype
by firefoxd 2y ago
The fundamental problem with React and the like, is that it forced developers to unlearn the anchor tag. If you can change the url via js why use an actual hyperlink tag?
Over the years, I'm seeing more and more unlearning of fundamental web from new frontend devs forged in boot camps.
- teddarific 2y agoThe entire disappearance of semantic HTML tags has been sad to see. It's just all <divs> inside of <divs> inside of <divs> these days.
- beeflet 2y agoTo be honest, as someone who like semantic HTML, it's a pain to search for an appropriate tag and then try to figure out how to undo all its quirks and re-style it.
- lmm 2y agoSemantic HTML was always a wrong half-solution to the problem. A website is always going to need custom semantics, the random grab-bag of whatever ideas people had back in 1993 is not a good set to base anything on.
- quectophoton 2y agoBut anchors and hyperlinks mean I make a new HTTP request to download the full page content, and make the browser re-draw only the parts that changed[1]. On the other hand, with something like react-router you can now just download the full page content[2] but without <head> [3], and then make the browser re-draw only the parts that changed. Only half-joking though. People can build things whatever way they like, and these frameworks can have good trade-offs. But sometimes the justifications devs give[4] just sound like they're reluctant to say "because I already know it, so I'm more efficient with it" or something like that. [1]: "Paint holding". [2]: Code splitting. [3]: These savings are probably offset by the library's 19kB, anyway. Or with that small icon that was inlined as base64. [4]: Which they don't need to give to anyone, unless it's for a situation like an employer asking for it.
- ahuth 2y agoYou're right that there's certainly bad HTML produced by React apps out there. But there's good HTML, too! As far as I can tell, React let's you write HTML in both the right and wrong ways, like all frameworks (including plain JS). Maybe it seems like React is worse in terms of HTML because of how popular it is? There are more users of it, so more potential examples of bad HTML?
- cheema33 2y ago> There are more users of it, so more potential examples of bad HTML? I think you have hit the nail on the head.
- beeflet 2y agoThere are some good use cases for this, for example soundcloud uses this to prevent reloading the page (and thus stopping the music when you click a link)
- firefoxd 2y agoFun fact, soundcloud uses links. React can use links and still be dynamic. The problem is without it, you break the browser history, you break long press menu on mobile, you lose the link preview in the status bar.
- beeflet 2y agodamn that's true. Soundcloud history sucks. It's unfortunate that there isn't a solution to this in the web standard.