Need help, NEXTJS 13 'app Dir'
How can I pass a function that is found on the Server Component to the Client Component?
I have Button which is a Client component and Another Server Component that wraps it. when The Button is Clicked I want execute the function passed down from Server Component. I don't want to change the Server Component to Client Component because it has large audio files and Images I don't want to render those components on client.
if there's any approach you've used to accomplish this I love to know.
When I try to pass down function from Server Component to Client I get this error.
client.js?7422:691 Uncaught Error: Functions cannot be passed directly to Client Components because they're not serializable.
<... intent=... action={function} children=...>