Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user