mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #1219 from syranide/jsxempty
Fix empty JSX expressions sometimes emitting erroneous commas
This commit is contained in:
+3
-1
@@ -130,7 +130,9 @@ function visitReactTag(traverse, object, path, state) {
|
||||
var childrenToRender = object.children.filter(function(child) {
|
||||
return !(child.type === Syntax.Literal
|
||||
&& typeof child.value === 'string'
|
||||
&& child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/));
|
||||
&& child.value.match(/^[ \t]*[\r\n][ \t\r\n]*$/)
|
||||
|| child.type === Syntax.XJSExpressionContainer
|
||||
&& child.expression.type === Syntax.XJSEmptyExpression);
|
||||
});
|
||||
if (childrenToRender.length > 0) {
|
||||
utils.append(', ', state);
|
||||
|
||||
Reference in New Issue
Block a user