Re:Exact – a new cross platform UI framework by the Expo team
by ricardobeat on Tuesday November 10, 2026 @04:48AM
(#50438058)
`class` is a valid property name in JS, since ES5 (2009).
React opted for backwards compatibility at the time it came out, and never made the upgrade - you can write `class` in Preact.
Re:Exact – a new cross platform UI framework by the Expo team
by troupo on Tuesday November 10, 2026 @06:15AM
(#50438706)
> React opted for backwards compatibility
I think they opted for what these properties are actually called in Javascript: https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
I wish they'd stick with that for all properties though.
Re:Exact – a new cross platform UI framework by the Expo team
by ricardobeat on Tuesday November 10, 2026 @06:23AM
(#50438784)
The rationale was to follow the DOM property names to avoid clashing with reserved keywords; not because mirroring JS was the goal. Data attributes for example have always been data-*, readonly, contenteditable in lowercase, mirroring HTML.
Re:Exact – a new cross platform UI framework by the Expo team
by troupo on Tuesday November 10, 2026 @09:28AM
(#50440884)
That is probably my bias showing, because I'd rather they adipted the JS property names for everything :) Less confusion
Re:Exact – a new cross platform UI framework by the Expo team
by halflife on Tuesday November 10, 2026 @05:24AM
(#50438307)
I know WHY it’s not possible, but that’s a design limitation of the parser being templating on top of JS, instead of a separate DSL with escape hatches for JS, like most other templating engines
Re:Exact – a new cross platform UI framework by the Expo team
by troupo on Tuesday November 10, 2026 @06:13AM
(#50438684)
It's not really a design limitation, as this way it simplifies the parser, the DSL, the templating... Basically everything. And your entire templating/parsing could be just "convert this to a function call"
Re:Exact – a new cross platform UI framework by the Expo team
by halflife on Tuesday November 10, 2026 @08:31AM
(#50440042)
Yes, it simplifies the engine, at the cost of developer experience. Like useMemo, that now is compiled in automatically with the new react compiler.
Re:Exact – a new cross platform UI framework by the Expo team
by troupo on Tuesday November 10, 2026 @09:27AM
(#50440878)
> Yes, it simplifies the engine, at the cost of developer experience.
Given that its taken the world by fire and nearly everyone adopted JSX/TSX as the templating language, doesn't seem like developer experience suffered.
> Like useMemo, that now is compiled in automatically
A completely different beast, and this one definitely makes DX suffer.
Re:Exact – a new cross platform UI framework by the Expo team
by halflife on Tuesday November 10, 2026 @01:24PM
(#50444157)
There are many reasons why JSX is popular, react being the biggest one, where subsequent frameworks wanted to leverage people’s knowledge.
However angular, svelte, vue and more have a specific DSL for templating.
Because it's a thin wrapper directly translatable into a JS function call. `className` is JS