Design Patterns · Middle · Question 60 of 75

How can composition avoid prop drilling without Context?

<Layout sidebar={<UserMenu user={user} />}>{children}</Layout>

Explanation

The component that owns the data renders the deep child directly; layout components just place it.

Further reading

Problem with a question

Design Patterns · Middle · question 60

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz