Design Patterns · Middle · Question 60 of 75
How can composition avoid prop drilling without Context?
<Layout sidebar={<UserMenu user={user} />}>{children}</Layout>- ✓Correct answer: Pass ready elements (children or slots) down, so intermediate components don't need to forward data they don't use
- 2Store everything in global variables
- 3Use
forwardRefeverywhere
Explanation
The component that owns the data renders the deep child directly; layout components just place it.