Skip to content

Commit

Permalink
Support un-braced element child in JSX transform
Browse files Browse the repository at this point in the history
facebookarchive/esprima#9 makes this possible.
  • Loading branch information
sophiebits committed Jan 18, 2014
1 parent ea711f1 commit 2eceb48
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vendor/fbtransform/transforms/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ function visitReactTag(traverse, object, path, state) {
}
} else if (attr.value.type === Syntax.Literal) {
renderXJSLiteral(attr.value, isLast, state);
} else {
} else if (attr.value.type === Syntax.XJSExpressionContainer) {
renderXJSExpressionContainer(traverse, attr.value, isLast, path, state);
} else if (attr.value.type === Syntax.XJSElement) {
traverse(attr.value, path, state);
if (!isLast) {
utils.append(',', state);
state.g.buffer = state.g.buffer.replace(/(\s*),$/, ',$1');
}
}
}

Expand Down

0 comments on commit 2eceb48

Please sign in to comment.