Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions vendor/fbtransform/transforms/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ function visitReactTag(traverse, object, path, state) {
}

var isFallbackTag = FALLBACK_TAGS.hasOwnProperty(nameObject.name);
utils.append(
(isFallbackTag ? jsxObjIdent + '.' : '') + (nameObject.name) + '(',
state
);
var tagOpening;
if (isFallbackTag) {
tagOpening = jsxObjIdent + '["' + (nameObject.name) + '"]' + '('
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this will break closure compiler minification. I think this would be a good idea if we could detect if it is not a valid JS identifier (ie. contains -) and use this only for invalid identifiers

} else {
tagOpening = nameObject.name + '('
}
utils.append(tagOpening, state);

utils.move(nameObject.range[1], state);

Expand Down