vasearar
vasearar

Reputation: 1

Is there a method to pass child value from (client component) to parent component (server side)?

I have a client side component that needs to pass a value to the parent component that is server side but I can't do that without useState or other hooks. Does anyone know how to do it?

I expect to get value without client side

Upvotes: 0

Views: 66

Answers (1)

Abraham
Abraham

Reputation: 81

You can't pass function props from a Next.js server component to a client component.

If you want parts of the parent to change and be able to handle child component events, extract the parts from the parent component that should be interactive into an intermediate component between your current parent and your current child and make it a client component as well.

Upvotes: 0

Related Questions