Skip to content

fix: update info about runtime JSX rendering#539

Merged
gabrielmfern merged 2 commits intocanaryfrom
fix/runtime-render-jsx-email
Sep 16, 2025
Merged

fix: update info about runtime JSX rendering#539
gabrielmfern merged 2 commits intocanaryfrom
fix/runtime-render-jsx-email

Conversation

@cassiozen
Copy link
Copy Markdown
Contributor

When using the react prop, we suggest calling React components as functions when JSX transpilation isn't available (e.g., EmailTemplate({firstName: "John", product: "MyApp"})). However, this approach has several limitations:

  • Components that use hooks may not work correctly when called directly as functions
  • React 19 introduces changes in component types (specifically React.FC) that will trigger errors

Solution: Recommend using jsx from react/jsx-runtime instead. This function is what build tools like Babel actually use to transform JSX at compile time, making it the most reliable alternative when JSX syntax isn't available.

This change updates the README to recommend the jsx function approach.

@cassiozen cassiozen requested a review from a team as a code owner June 25, 2025 16:46
Copy link
Copy Markdown
Member

@gabrielmfern gabrielmfern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gabrielmfern gabrielmfern merged commit 0e34a54 into canary Sep 16, 2025
10 checks passed
@gabrielmfern gabrielmfern deleted the fix/runtime-render-jsx-email branch September 16, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants