Skip to content

Does composeRenderProps only work on client components? #5767

Answered by devongovett
adneforslund asked this question in Q&A
Discussion options

You must be logged in to vote

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 to className, 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.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@adneforslund
Comment options

@devongovett
Comment options

Answer selected by adneforslund
@abhion
Comment options

@ondrejkralik
Comment options

@oemer-aran
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants