11 ms·
> JSX is decidedly not JavaScript, it is an extension to JavaScript. No, JSX is JavaScript. You can write it in function calls or JSX, it's just syntactic suga
by s_y_n_t_a_x 7y ago
> JSX is decidedly not JavaScript, it is an extension to JavaScript.
No, JSX is JavaScript. You can write it in function calls or JSX, it's just syntactic sugar.
> Fair enough, but this prevents many optimizations because the render method can produce virtually anything.
No, using a library doesn't mean the function used from the library isn't pure. Yes it could have side-effects, but the point is you aren't restricted. You can use pure functions or anything else.
> In any case, since svelte is a compiler, it should be possible to type-check components as well.
Yes. But it doesn't, and you get it for free because TSX is just TypeScript. If wishes and buts were candy and nuts...