Open paulflew opened 4 weeks ago
U have to use the "use client"
directive in order to pass functions/components down the tree.
RSC can only accept React.ReactNode
aka children
as props, because JSX can be serializable.
A couple of further notes:
1) Placing
2) A workaround is to indeed wrap the components to explicitly make them client-side, e.g. adding an extra file as icons.tsx:
'use client'
import { MdHistory } from 'react-icons/md'
export { MdHistory }
This renders correctly.
Steps to reproduce
Current behavior
Rendering gives an Internal Server Error: 'Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it. <... title="test" icon={function MdHistory}>'
Expected behavior
Page should be rendered successfully