fix react inline elements plugin when creating properties out of jsx expression containers - fixes #2766
This commit is contained in:
parent
c1cceef128
commit
91c463c0f7
@ -0,0 +1,5 @@
|
|||||||
|
var TestComponent = React.createClass({
|
||||||
|
render: function () {
|
||||||
|
return <span className={this.props.someProp} />;
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
var TestComponent = React.createClass({
|
||||||
|
render: function () {
|
||||||
|
return {
|
||||||
|
$$typeof: babelHelpers.typeofReactElement,
|
||||||
|
type: "span",
|
||||||
|
key: null,
|
||||||
|
ref: null,
|
||||||
|
props: {
|
||||||
|
className: this.props.someProp
|
||||||
|
},
|
||||||
|
_owner: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -38,6 +38,7 @@ export default function ({ types: t }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pushProp(objProps, key, value) {
|
function pushProp(objProps, key, value) {
|
||||||
|
if (t.isJSXExpressionContainer(value)) value = value.expression;
|
||||||
objProps.push(t.objectProperty(key, value));
|
objProps.push(t.objectProperty(key, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user