Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
function AComponent () {
|
||||
return <BComponent/>
|
||||
|
||||
function BComponent () {
|
||||
return <n:CComponent />
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
var _n$CComponent;
|
||||
|
||||
function AComponent() {
|
||||
return <BComponent />;
|
||||
|
||||
function BComponent() {
|
||||
return _n$CComponent || (_n$CComponent = <n:CComponent />);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user