JSX is template literals but instead of `` syntax you use <></>
11 replies
@zachleat if only string templates had dropped before jsx appeared. We could've avoided the whole thing.
@polotek whew, could’ve saved a lot of tooling complexity!
@asci have you used any framework besides react? You know they've all solved these problems without jsx right? You may be making some assumptions about what I'm saying. I'm not suggesting that template literals is a complete solution. I am saying that if we had template strings, the solution would've been simpler and more compatible with JavaScript.
@polotek yea, I’ve been using Backbone (also w/ Marionette), Knockout and a bit of Angular. They all suffered from rigid composition issues with templates. I also tried Solid, but with manually manipulating DOM elements (may not be the best practice, it was an interview requirement) and had a side project on Elm. I not saying that it is not possible to make good solution using templates strings, but I can’t imagine that. An example may help, otherwise it seems like a hot take
@asci I'm sorry you have such a poor imagination. Feel free to keep preferring react and jsx. You're allowed to do that, and it's not a big issue for me. Thanks for stopping by.
@zachleat use this all the time in lots of personal projects https://github.com/jimniels/html
@jimniels this would have been much more compatible with the web platform!