Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Lazy loading React components

Lazy Loading is loading dependent modules / components dynamically, this is done to optimize the initial load time of larger React Applications which have multiple components and 3rd part library dependencies.

In React 16.6 lazy loading is enabled by using React.lazy function and the Suspense component. React.lazy is used to lazy load react components from the same or different bundle file and the Suspense component is used to display a fallback UI till the dependent component / bundle is loaded. Lazy loading and code-splitting works together to enable optimization of initial load time for large React Applications.


This post first appeared on C# Guide, please read the originial post: here

Share the post

Lazy loading React components

×

Subscribe to C# Guide

Get updates delivered right to your inbox!

Thank you for your subscription

×