From 2eceb48073d323ebf513a56e5e42a2dd6bd8604c Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 17 Jan 2014 22:24:58 -0800 Subject: [PATCH] Support un-braced element child in JSX transform facebook/esprima#9 makes this possible. --- vendor/fbtransform/transforms/react.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendor/fbtransform/transforms/react.js b/vendor/fbtransform/transforms/react.js index af5aa7dbedcfc..c12bea1bd52d9 100644 --- a/vendor/fbtransform/transforms/react.js +++ b/vendor/fbtransform/transforms/react.js @@ -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'); + } } }