State Management · Senior · Question 9 of 75

What does use(Context) in React 19 add compared to useContext?

Explanation

use isn't bound by the "top-level only" rule, so if (!show) return null; const theme = use(ThemeContext) works. Otherwise it reads the same nearest provider and doesn't add selectors.

Further reading

Problem with a question

State Management · Senior · question 9

Test yourself

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

Take this quiz