React · Senior · Question 10 of 75
What does the 'use client' directive at the top of a file do?
- ✓Correct answer: Marks a boundary: the module and everything it imports go into the client bundle
- 2Forbids rendering the component on the server; it renders only in the browser
- 3Enables strict checking of client hooks for this module
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.