You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Interns leading and trailing comments around JSX identifiers, just like leading and trailing comments are interned in non-jsx identifiers.
This gets us comment attachment in JSX element names:
```
</* L id */ div /* T id */>
test
</ /*L id */ div /* T id */>
```
And around the names of JSX attributes:
```
<div
/* L id */ name /* T id */ ="value"
/* L id */ name2 /* T id */
/>
```
However note that it is ambiguous whether a comment between the tag name and the first attribute name should be attached as a trailing comment of the name or a leading comment of the first attribute name. (The same is true of adjacent attributes without values). This will be fixed in the future once we have an API for eating portions of comments, as this same problem appears for the trailing comments on statements.
Reviewed By: pieterv
Differential Revision: D20315238
fbshipit-source-id: 728a629398686123e5f998a154fff81077d65521
0 commit comments