Complete the code to import the Suspense component from React.
import { [1] } from 'react';
The Suspense component is imported from React to enable streaming UI with fallback content.
Complete the code to wrap the component with Suspense and provide a fallback UI.
<Suspense fallback=[1]>
<Profile />
</Suspense>The fallback prop shows a loading spinner while the Profile component is loading.
Fix the error in the code to correctly use Suspense with a lazy-loaded component.
const LazyProfile = React.lazy(() => import('./Profile')); export default function Page() { return ( <Suspense [1]> <LazyProfile /> </Suspense> ); }
The Suspense component requires a fallback prop with a React element to show while loading.
Fill both blanks to create a streaming component with Suspense and a loading fallback.
export default function StreamPage() {
return (
<[1] [2]={<Spinner />}>
<UserData />
</[1]>
);
}Suspense wraps the UserData component and uses the fallback prop to show a spinner while loading.
Fill all three blanks to implement streaming with Suspense and a fallback loading message.
import { [1] } from 'react'; const LazyComments = React.lazy(() => import('./Comments')); export default function CommentsPage() { return ( <[2] [3]={<p>Loading comments...</p>}> <LazyComments /> </[2]> ); }
Suspense is imported and used to wrap LazyComments with a fallback prop showing a loading message.