4 ms·
TBH this sounds like it should be a new transform, not in the default one. Speaking for myself, I rather this be an alternative so I can get the best perf on m
by aylmao 6y ago
TBH this sounds like it should be a new transform, not in the default one.
Speaking for myself, I rather this be an alternative so I can get the best perf on my React apps, but have the option to switch to this when experimenting with using JSX for other things. This is an interesting concept, you should build it (:
- phpnode 6y agoWriting an alternative babel plugin to do the transform this way would be pretty trivial, but doing so for TypeScript is not (officially) possible. TS is going to choose one and it's going to be the one React uses. Also the decision to split React's createElement() into jsx() and jsxs() means that to maintain compatibility all libs would have to do the same, and provide both functions, all because of an implementation quirk in React. JSX should be a standalone thing. It's not intrinsically React, and shouldn't bend to React's needs alone.