React · Senior · Question 10 of 75

What does the 'use client' directive at the top of a file do?

Explanation

'use client' goes at the entry point of a client subtree, not in every file: imported modules automatically become client modules. Client components are still rendered on the server during SSR (into HTML) and hydrated in the browser.

Further reading

Problem with a question

React · Senior · question 10

Test yourself

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

Take this quiz