#462
feat(react-email): support $computed functions and custom directives in render
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
RenderOptionsgainsfunctionsanddirectives(same shape as the React<Renderer>props).- The render pass carries one base context (
stateModel,functions,directives) instead of juststateModel, so every element, repeat child andvisiblecondition sees them.
Tests
- 2 new tests in
render.test.tsx($computedviafunctions, custom directive viadirectivesin both HTML and plain text). Both fail without the change. packages/react-email: 35/35 pass,tsc --noEmitclean.
Pairs with #458: once that lands, directives also work as operands in visible conditions here.
🤖 Generated with Claude Code
Activity
4copilot-pull-request-reviewer[bot]reviewed5d 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.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated |
|---|---|---|---|
| json-render-chat-sdk-demo | Error | v0 | Nov 7, 2026 9:21pm UTC |
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.