Lazy loading

We saw that react loads all code in the bundle at once, to prevent the concept of lazy loading. To implement lazy loading use React.lazy(). While using it you need to wrap the component using <Suspense fallback={LoadingPage} ><YourComponent><Suspense>, because when you apply lazy loading your code becomes asynchronous and you have to prevent it. Suspense helps in this. It does not make sense for a small app but it is useful in a big app.