Bird
0
0

Given this Remix component code:

medium📝 component behavior Q13 of 15
Remix - Performance
Given this Remix component code:
import React, { Suspense } from 'react';
const LazyComp = React.lazy(() => import('./LazyComp'));

export default function App() {
  return (
    Loading...
}> ); }
What will the user see initially when App renders?
ANothing until LazyComp finishes loading.
BThe
Loading...
text until LazyComp loads.
CAn error because Suspense is missing fallback.
DLazyComp renders immediately without delay.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Suspense fallback role

    Suspense shows the fallback UI while the lazy component is loading.
  2. Step 2: Analyze the code behavior

    Since LazyComp is lazy loaded,
    Loading...
    appears first until LazyComp finishes loading.
  3. Final Answer:

    The <div>Loading...</div> text until LazyComp loads. -> Option B
  4. Quick Check:

    Suspense fallback shows loading UI [OK]
Quick Trick: Suspense fallback shows while lazy component loads [OK]
Common Mistakes:
MISTAKES
  • Thinking lazy components render instantly
  • Forgetting Suspense fallback is required
  • Assuming no UI shows during loading

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes