It's about as pure as you can get while having any sort of html-ish 'templating' whatsoever.
So, I'd say it's exactly in the right place to be making purity criticisms. They've taken the only approach that preserves the integrity of the code and doesn't involve build time magic.
function MyComponent() {
return For({
each: [1,2,3,4],
children: x => <div>{x}</div>,
})
)
It's just a function call, and it doesn't even need `React.createElement`. What's more pure than that?But coming back to JSX, a custom function call syntax is OK and pure because it has a one to one mapping on line number?
I don't know if there's much point in discussing purity since it's badly defined and mostly in the eyes of the beholder, but it always smelled like one hacky syntactic sugar to me.
It has no intrinsic semantics, and maps pretty much directly to actual javascript (which you can write directly or use an alternative helper for — hyperscript being a common one).
I'm right there with you, but when React invents a whole markup language inside of JavaScript, it's not in much of a standing to make purity criticisms.