Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

suspense react

import React, {Suspense} from 'react;
const ProfilePage = React.lazy(() => import('./ProfilePage')); // Lazy-loaded

// Show a spinner while the profile [data fetching] is loading
<Suspense fallback={<Spinner />}>
  <ProfilePage />
</Suspense>
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #suspense #react
ADD COMMENT
Topic
Name
9+6 =