Lazily initialize and cache constant JSX elements (#12967)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
This commit is contained in:
Nicolò Ribaudo
2021-03-06 17:33:43 +01:00
committed by GitHub
parent d04842a700
commit 8dacf85859
72 changed files with 695 additions and 209 deletions

View File

@@ -1,9 +1,9 @@
var _ref = <span />;
var _span;
var Foo = React.createClass({
render: function () {
return <div className={this.props.className}>
{_ref}
{_span || (_span = <span />)}
</div>;
}
});