arrow_backBACK TO DRILLS
Black Beltserver-componentsPREMIUM
A Client Component's Export Cannot Be Called as a Function From Server Code
A Server Action attempts to reuse a Client Component's export to generate HTML for an email.
REACT_MODULE // 0x42
'use client';
export default function EmailButton({ label }) {
return <button>{label}</button>;
}
// app/actions.ts (Server Action file)
import EmailButton from './EmailButton';
export async function generateEmailHtml() {
const html = EmailButton({ label: 'Confirm' });
return html;
}Why does calling EmailButton({ label: 'Confirm' }) directly inside the Server Action fail?