State Management · Middle · Question 11 of 75

When is it better to put a value in Context instead of passing it explicitly through props?

Explanation

Context trades explicitness for convenience: it's harder to see where data comes from, and components depend on a provider being present. Use it for truly cross-cutting values; otherwise explicit props or composition are clearer.

Further reading

Problem with a question

State Management · Middle · question 11

Test yourself

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

Take this quiz