Nicolò Ribaudo 8dacf85859
Lazily initialize and cache constant JSX elements (#12967)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2021-03-06 17:33:43 +01:00

12 lines
303 B
JavaScript

var _div;
import React from "react";
import OtherComponent from "./components/other-component";
export default function App() {
return _div || (_div = <div>
<LazyComponent />
<OtherComponent />
</div>);
}
const LazyComponent = React.lazy(() => import("./components/lazy-component"));