-
-
Replying to @ryanflorence @PrettierCode
Hmm, ok I see the difference here. I have a feeling the issue stems from something specific in JSX perhaps? If you drop that into a plain HTML file and run in the browser, does the same issue happen?
1 reply 0 retweets 0 likes -
Replying to @svinkle @PrettierCode
Quite the opposite actually. JSX does *not* introduce the nbsp, plain HTML does! One of my favorite things about JSX, I can opt-in to adding a space, but in plain HTML I cannot opt-out.
2 replies 1 retweet 14 likes -
Prettier would format the code the way you want it if it was JSX, but it would do the thing you don't like in plain html.
1 reply 0 retweets 0 likes -
FYI, here's the source of the screenshot, it's not JSX. If it were, we wouldn't have this problem (but we could opt-in to the space if we wanted to)https://gist.github.com/f698b3b504a765d9178feb4d3b5a505c …
1 reply 0 retweets 2 likes -
Replying to @ryanflorence @PrettierCode
Hmm, I see. Much to ponder. Thank you for your explanations and time, Ryan!
2 replies 0 retweets 5 likes -
Replying to @svinkle @PrettierCode
My pleasure. There are other subtle display bugs you get with that extra whitespace. Prettier needs to keep your HTML accurate, if you didn't have whitespace between elements originally, it won't introduce it when it formats to new lines, the only way is gross splitting on ">".
2 replies 1 retweet 15 likes -
In the JSX case, it compiles down to function calls and it does not introduce a text node for a newline. But you can opt-in if you want with the ol' ugly `{" "}`. This was one of the small-but-exciting things for me in JSX. I could finally format my "html" cleanly w/o bugs
1 reply 0 retweets 10 likes -
@syranide revamped the whole whitespace handling in JSX early on. This one of the many small things in React that saved engineers countless hours without people really noticing.1 reply 1 retweet 15 likes -
Replying to @Vjeux @ryanflorence and
also confuses people all the time if I could do it again I think I’d just do quotes around all text
6 replies 0 retweets 11 likes
JSX 2.0?pic.twitter.com/CfyjhkPIko
-
-
Replying to @sebmck @sophiebits and
https://github.com/facebook/jsx/issues/8 … https://github.com/facebook/jsx/issues/35 … there's been discussion on it, but it's been inactive for a long time.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 