Does composeRenderProps only work on client components? #5767
-
I have just started to use RAC with Next.js 14.1 and I have used the https://react-spectrum.adobe.com/react-aria-tailwind-starter as a starting point. But every time I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Probably? I guess since it returns a function that would need to be in a client component since functions can't be serialized. |
Beta Was this translation helpful? Give feedback.
Yes, all React Aria components are client components because they use state and event handlers. I think this particular webpack error is potentially a next.js bug, but if you got rid of
composeRenderProps
and passed a function toclassName
, you'd see a different one: "Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server"." This means you need to make your component that's passing the function into a client component as well.