Skip to main content Accessibility Feedback

Why is JSX still a thing?

Yesterday on Mastodon, Adrian Roselli shared this brilliant article by Johan Halse about React and the state of the web.

In it, Johan writes…

For every person working on GMail you have a hundred people doing unglamorous maintenance on various Wordpress or dot-net CRUD apps. The amount of “applications” that totally should have been plain-vanilla websites is also too damn high. The web is—let’s just face it—basically a hundred million forms, and a couple of successful outliers that have to be something else.

Hell yes!

Adrian pulled out this quote from the piece…

My wish for 2024 is that everyone gets the epiphany that React is legacy tech from 2013 when browsers didn’t have template strings or a BFCache.

I agree, but I also think that until browser’s get a proper native diff() method that can take a template string and update the existing UI to match it with as little destruction as possible, state-based UI tools are here to stay.

(They will of course live on long after that because tools have inertia. jQuery still powers a comically large amount of the web for fucks sake!)

But JSX? Once template literals showed up, I have no idea why JSX didn’t die out immediately.

Even modern state-based UI libraries that work with plain old template literals still offer (and typically default to) JSX in their docs. I don’t get it!

If you’re in the mood for a good, well articulated rant, go read Johan’s whole article. It’s quite good!