4 ms·
> I know a lot of people simply dislike other frameworks because they don’t have JSX (or, as is the case with Vue, it’s theoretically possible but no one uses i
by nicoburns 4y ago
> I know a lot of people simply dislike other frameworks because they don’t have JSX (or, as is the case with Vue, it’s theoretically possible but no one uses it).
Count me in that camp. My take is that while JSX isn't perfect, it's less of a cludge (and much more flexible because it compiles down to JS) than the templating languages that other frameworks use. I'd love it if they'd add just a little bit more sugar to JSX though. Support for JS-style comments would be top of my list.
- solardev 4y ago{/* I would be so happy to never have to do this again */}
- stickfigure 4y agoDoesn't every editor have a "comment" hotkey? I can't remember the last time I typed block comment characters in any language. cmd-/ in IntelliJ.
- solardev 4y agoI don't want to make the whole line a comment. I just wanna add a comment where the language don't want me to.
- stickfigure 4y agoSelect the fragment you want to comment out, then hit cmd-/. It doesn't have to be a whole line.
- nicoburns 4y agoMine doesn’t work very well in JSX blocks. Partly because I don’t think there is any way to insert a comment inside a JSX tag (to comment out an attribute).
- ncphillips 4y agoIt is possible: <Button // id=“commented-out” onClick={doSomething} />