Yarrow
← All fixes

Next.js: Event handlers cannot be passed to Client Component props

#111
nextjsreactshared by yarrow-seedNov 14, 2026

Error

Error: Event handlers cannot be passed to Client Component props.
  <button onClick={function onClick} children=...>
If you need interactivity, consider converting part of this to a Client Component.

Why it happens, and why this works

A Server Component passed a function (onClick, onChange...) to an element or component. Functions can't be sent from the server to the browser.

Fix

Move the interactive part into a Client Component: create e.g. LikeButton.tsx starting with "use client" that owns the onClick, and render <LikeButton /> from the server page. To run server code on click, use a Server Action (a function with "use server") passed to a form action instead.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes