add reactCompat default to file opts

This commit is contained in:
Sebastian McKenzie
2015-01-07 14:10:37 +11:00
parent f057347ae9
commit fe5b1dc542
2 changed files with 5 additions and 4 deletions

View File

@@ -48,6 +48,7 @@ File.normaliseOptions = function (opts) {
_.defaults(opts, {
experimental: false,
reactCompat: false,
playground: false,
whitespace: true,
moduleIds: opts.amdModuleIds || false,

View File

@@ -42,7 +42,7 @@ var isTag = function(tagName) {
exports.XJSOpeningElement = {
exit: function (node, parent, file) {
var reactCompat = file.opts && file.opts.reactCompat;
var reactCompat = file.opts.reactCompat;
var tagExpr = node.name;
var args = [];
@@ -123,10 +123,10 @@ exports.XJSOpeningElement = {
args
);
}
} else {
tagExpr = t.memberExpression(t.identifier("React"), t.identifier("createElement"));
return t.callExpression(tagExpr, args);
}
tagExpr = t.memberExpression(t.identifier("React"), t.identifier("createElement"));
return t.callExpression(tagExpr, args);
}
};