3 ms·
For what it’s worth, JSX is exactly designed for this kind of usage. It’s just a syntax extension, and it only specifies the way syntax can be used in an expres
by eyelidlessness 5y ago
For what it’s worth, JSX is exactly designed for this kind of usage. It’s just a syntax extension, and it only specifies the way syntax can be used in an expression position. It explicitly allows dot access (but doesn’t specify its behavior).
While it’s common to treat JSX as syntax sugar for hyperscript, even that isn’t specified. JSX is a compiler hint with expression semantics, that’s all. You can see how dramatically different it can be in plain JS by looking at compiled output from dom-expressions (most commonly used in SolidJS).