#462

feat(react-email): support $computed functions and custom directives in render

Openharold18mwants to merge intofrom

Closes #459

renderToHtml / renderToPlainText built the prop context with only stateModel and repeat scope, so $computed expressions and custom $-directives stayed unresolved in emails, while the same spec worked in the React renderer.

Changes

  • RenderOptions gains functions and directives (same shape as the React <Renderer> props).
  • The render pass carries one base context (stateModel, functions, directives) instead of just stateModel, so every element, repeat child and visible condition sees them.

Tests

  • 2 new tests in render.test.tsx ($computed via functions, custom directive via directives in both HTML and plain text). Both fail without the change.
  • packages/react-email: 35/35 pass, tsc --noEmit clean.

Pairs with #458: once that lands, directives also work as operands in visible conditions here.

🤖 Generated with Claude Code

Activity

4
copilot-pull-request-reviewer[bot]reviewed5d ago
copilot-pull-request-reviewer[bot]5d ago

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

vercel[bot]5d ago

@harold18m is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot]5d ago

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
json-render-chat-sdk-demo Errorv0Nov 7, 2026 9:21pm UTC