Fix React constant elements transform from hoisting elements to positions where their referenced bindings haven't been evaluated yet (#3596)
This commit is contained in:
committed by
Henry Zhu
parent
8d14f9f4d0
commit
3b4b3656a8
@@ -0,0 +1,14 @@
|
||||
const AppItem = () => {
|
||||
return <div>child</div>;
|
||||
};
|
||||
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
var _ref = <div>child</div>;
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref;
|
||||
};
|
||||
|
||||
var _ref2 = <div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>;
|
||||
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
(function () {
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const AppItem = () => {
|
||||
return <div>child</div>;
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
var _ref = <p>Parent</p>;
|
||||
|
||||
var _ref2 = <div>child</div>;
|
||||
|
||||
(function () {
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return <div>
|
||||
{_ref}
|
||||
<AppItem />
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref2;
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
(function () {
|
||||
const AppItem = () => {
|
||||
return <div>child</div>;
|
||||
};
|
||||
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
var _ref = <div>child</div>;
|
||||
|
||||
var _ref3 = <p>Parent</p>;
|
||||
|
||||
(function () {
|
||||
const AppItem = () => {
|
||||
return _ref;
|
||||
};
|
||||
|
||||
var _ref2 = <div>
|
||||
{_ref3}
|
||||
<AppItem />
|
||||
</div>;
|
||||
|
||||
class App extends React.Component {
|
||||
render() {
|
||||
return _ref2;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<p>Parent</p>
|
||||
<AppItem />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const AppItem = () => {
|
||||
return <div>child</div>;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
var _ref = <p>Parent</p>;
|
||||
|
||||
export default class App extends React.Component {
|
||||
render() {
|
||||
return <div>
|
||||
{_ref}
|
||||
<AppItem />
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
var _ref2 = <div>child</div>;
|
||||
|
||||
const AppItem = () => {
|
||||
return _ref2;
|
||||
};
|
||||
Reference in New Issue
Block a user