October 2019
Intermediate to advanced
426 pages
11h 49m
English
First, we have to specify a loading indicator, which will be shown when our lazily-loaded component is loading. In our example, we are going to wrap the UserBar component with React Suspense.
Edit src/App.js, and replace the <UserBar /> component with the following code:
<React.Suspense fallback={"Loading..."}> <UserBar /> </React.Suspense>
Now, our app is ready for implementing lazy loading.
Read now
Unlock full access