Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
function fn(Component) {
|
||||
var data = "prop",
|
||||
_ref = <Component prop={data} />;
|
||||
var _Component;
|
||||
|
||||
return () => _ref;
|
||||
var data = "prop";
|
||||
return () => _Component || (_Component = <Component prop={data} />);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user