Bird
0
0

Why does this Remix route cause slower performance?

medium📝 Debug Q7 of 15
Remix - Performance
Why does this Remix route cause slower performance? export async function loader() { const data = await fetch('https://slow.api/data').then(res => res.json()); return json(data); } Options: A) The external API is slow B) The loader function is not async C) The json() helper is missing D) The fetch URL is incorrect
AThe loader function is not async
BThe external API is slow
CThe json() helper is missing
DThe fetch URL is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the loader function

    The loader is async, uses json() helper, and fetch URL looks valid.
  2. Step 2: Identify cause of slow performance

    The external API endpoint is slow, causing the loader to wait longer before sending data.
  3. Final Answer:

    The external API is slow -> Option B
  4. Quick Check:

    Slow external API = Slow loader response [OK]
Quick Trick: Slow external APIs delay Remix loaders [OK]
Common Mistakes:
MISTAKES
  • Thinking loader must not be async
  • Assuming json() helper is missing
  • Believing fetch URL is incorrect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes