React.lazy()
uses dynamic imports to defer loading component’s code until it’s rendered for the first time:React.lazy
since we have only one component, App
, that loads it immediately. It makes more sense in multi-view applications that use a router or where we want to optimize the bundle avoiding to weigh with the code all components when the application bootstraps.