We need to use lazy loading to optimize and improve performance of our app by loading components only when they are needed.
When do we use lazy() loading?
-
Large application where the initial size becoming too heavy.
-
Rarely used components ex: setting dashbord;
-
Routes pages: where only the page needed when we visit. first need to loads initially.
-
Features heavy apps that needed immediately like chats , admin pannels etc.
-
performance-sensitive envirnoments, especially mobile with slow networks