Quotes

  • Always use double quotes (") for JSX attributes, but single quotes (') for all other JS. eslint: jsx-quotes

    Why? Regular HTML attributes also typically use double quotes instead of single, so JSX attributes mirror this convention.

    1. // bad
    2. <Foo bar='bar' />
    3. // good
    4. <Foo bar="bar" />
    5. // bad
    6. <Foo style={{ left: "20px" }} />
    7. // good
    8. <Foo style={{ left: '20px' }} />