0 day streak
javascript / beginner
Snippet

Enabling Interactivity with 'use client'

In Next.js, this directive at the top of a file tells the framework that the component should be rendered on the client side, allowing for hooks and interactivity.

snippet.js
javascript
1
'use client';
nextjs
Breakdown
1
'use client';
Must be the very first line to switch from Server to Client Component.