Giter Site home page Giter Site logo

Comments (6)

syranide avatar syranide commented on August 20, 2024

facebook/react#480 (comment), there is also the full technical reasoning facebook/react#480, but it may be a bit hard to digest.

The idea being that indentation is not intended for output and trailing whitespace is a bad idea all-around. 2 is added because that is almost universally what you want and not having it is really really cumbersome and mistake-prone.

from jsx.

basarat avatar basarat commented on August 20, 2024

@syranide reading that I can only see that there is one more rule regarding tab handling. I've updated the original question with point 3, and also see demo

Cheers 🌹

from jsx.

RReverser avatar RReverser commented on August 20, 2024

This question is being raised rather often, I'm thinking maybe we should add some kind of react.md in this repo?

from jsx.

basarat avatar basarat commented on August 20, 2024

I'm thinking maybe we should add some kind of react.md in this repo?

I would prefer whitespace.md. Even though the thing I am discussing feels react emit specific, but I feel that not having whitespace rules specified in jsx decreases its portability.

Consider:

<div> 
test
</div>

Would be weird if something things see it as test (like react) and other's see it as \ntest\n. But react.md is fine as well :)

from jsx.

syranide avatar syranide commented on August 20, 2024

@basarat "other's see it as \ntest\n", which ones are that?

from jsx.

basarat avatar basarat commented on August 20, 2024

"other's see it as \ntest\n", which ones are that?

Other implementations that might use JSX for an HTML emit

from jsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.