State Management · Senior · Question 7 of 75

Why are Context providers in the Next.js App Router placed in a separate client component?

Explanation

A 'use client' providers.tsx wraps children, which stay server components because they're passed as props. Place providers as deep as possible so more of the tree remains static.

Further reading

Problem with a question

State Management · Senior · question 7

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