feature: Support pure expressions in transform-react-constant-elements (#4812)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
// https://github.com/facebook/react/issues/3226
|
||||
// Not safe to reuse because it is mutable
|
||||
function render() {
|
||||
return <div style={{ width: 100 }} />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// https://github.com/facebook/react/issues/3226
|
||||
// Not safe to reuse because it is mutable
|
||||
function render() {
|
||||
return <div style={{ width: 100 }} />;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
function render(offset) {
|
||||
return function () {
|
||||
return <div tabIndex={offset + 1} />;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
function render(offset) {
|
||||
var _ref = <div tabIndex={offset + 1} />;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
const OFFSET = 3;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return (
|
||||
<div tabIndex={OFFSET + 1} />
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
const OFFSET = 3;
|
||||
|
||||
var _ref = <div tabIndex={OFFSET + 1} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return (
|
||||
<div data-text={
|
||||
"Some text, " +
|
||||
"and some more too."
|
||||
} />
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
var _ref = <div data-text={"Some text, " + "and some more too."} />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user