React · Senior · Question 67 of 75
How do you avoid a waterfall when a Server Component needs two independent requests?
const [user, posts] = await Promise.all([getUser(id), getPosts(id)]);- ✓Correct answer: Start both requests before awaiting (e.g.
Promise.all), or split into separate components under Suspense - 2Await them one after another - it's always fastest
- 3Fetch them in a client effect instead
Explanation
Sequential awaits double the latency. Separate Suspense boundaries additionally let the faster part stream in first.