convert property key to computed before checking if it's a displayName property in the react transformer builder - closes #1671
This commit is contained in:
parent
9dcceaeb40
commit
ffbf5b0b47
@ -161,7 +161,8 @@ export default function (exports, opts) {
|
||||
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var prop = props[i];
|
||||
if (t.isIdentifier(prop.key, { name: "displayName" })) {
|
||||
var key = t.toComputedKey(prop);
|
||||
if (t.isLiteral(key, { value: "displayName" })) {
|
||||
safe = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,6 +1,13 @@
|
||||
var Whateva = React.createClass({
|
||||
displayName: "Whatever",
|
||||
render: function render() {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
var Bar = React.createClass({
|
||||
"displayName": "Ba",
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
@ -4,3 +4,10 @@ var Whateva = React.createClass({
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
var Bar = React.createClass({
|
||||
"displayName": "Ba",
|
||||
render: function render() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user