Arrreg!! So many of these React (et al) sites, with poorly re-built elements and break the built-in functionality! The A tag works perfect! But no, we need three or four nested divs, components, and many lines of JS to end up with something worse.
Is React the driver? Do devs just not know? Is management pushing garbage?
With every client-side routing framework or library I know of, the trivial happy path will involve using their provided link component which performs client-side navigations on click but also renders an underlying anchor tag with href (and works with cmd-click, middle-click etc.).
You really have to go out of your way to break this, and I don't think client-side routers deserve any blame for this. Anyone who is ignorant or careless enough to ship broken links using a client-side router would be just as likely to break anchor tags with their own hand-rolled JavaScript.
> Is React the driver? Do devs just not know? Is management pushing garbage?
I'd say developers who aren't web developers trying to do web dev seems to be the cause of this. Understanding the platform you're developing for is pretty much table stakes for any developer, and not understanding when to use <a> is pretty much the most basic mistake you can make. Literally the first things you learn in web development is about linking to other pages, yet somehow still people fuck up putting a <a> into a webpage properly. Boggles my mind.
React makes it as easy as any other library/framework, but if you don't think about what ends up in the DOM, and why certain things have to be a specific way (often for accessibility and user experience), then you'll screw up even big and expensive projects like this apparently. 2x boggling since this project is literally all about user experience yet they get the most fundamental part of the web wrong.
> I'd say developers who aren't web developers trying to do web dev seems to be the cause of this.
Hard disagree. I've seen a ton of decent web developers (i.e. people who can use modern CSS, layouts, and modern web stacks) reinventing buttons and links and forgetting about accessibility.
It's a completely orthogonal thing to the dev background.
If you render an <a> in React (or Angular, which I think they're using here), it's just an <a>! You have to do extra work to fuck it up!
I was digging into the cursor effect just to see why it's so laggy for some people and noticed that this is actually a Next.js site.
That is news to me that Google is using Nextjs for anything.
I'll generally excuse things like laziness and incompetence, because I understand that not everyone is good at their jobs.
But this:
> You have to do extra work to fuck it up!
resonates so hard. I get so angry at people who take extra time out of their day to put so much effort into making things worse. So many things on the internet are fine, but people spend so much on making them worse. Who is this good for? Not me, and likely not the person who wasted their time ruining functional things.
It doesn’t do the internal navigation.
And since React doesn’t have built-in support for pushState (Yes I know React Router, but it really wants a hash router), you really need extra work for an internal router. And therefore, every beginner dev does it manually and slightly inconsistently.
So yes, React is absolutely the driver, same as Java is guilty for Guava existing, because it should have been built-in and perfect.
> Yes I know React Router, but it really wants a hash router
This doesn't sound right. The history API has been widely supported by all major browsers (including mobile) since 2013. React was also first released in 2013. Did React Router ever ship a version without a HistoryRouter.
In this case we are not talking about beginner devs (to their credit, the React docs are pushing people toward frameworks now) — these are literally the developers of a framework, fucking it up in their own docs!
One of my pet peeves is people blaming things on React that have nothing to do with React. I see this quite frequently on Hacker News. Using an a tag or not has nothing to do with React.