-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JSX: Improved spread operator in tag attributes (#2159)
This allows any number of spaces around JSX attribute spread expressions.
- Loading branch information
1 parent
8678045
commit fd857e7
Showing
3 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<div {...foo}></div> | ||
<div { ...foo }></div> | ||
<div { ... foo }></div> | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"div" | ||
]], | ||
["spread", [ | ||
["punctuation", "{"], | ||
["punctuation", "..."], | ||
["attr-value", "foo"], | ||
["punctuation", "}"] | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"div" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"div" | ||
]], | ||
["spread", [ | ||
["punctuation", "{"], | ||
["punctuation", "..."], | ||
["attr-value", "foo"], | ||
["punctuation", "}"] | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"div" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"div" | ||
]], | ||
["spread", [ | ||
["punctuation", "{"], | ||
["punctuation", "..."], | ||
["attr-value", "foo"], | ||
["punctuation", "}"] | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"div" | ||
]], | ||
["punctuation", ">"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Allow spaces in spread operator brackets in JSX tags. |