Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Feb 8, 2024

Our rendering utility is meant to be optional. This comes from our apparent philosophy. Things should be flexible and minimal, from where I see it.
If we are to act on that idea, we need to pay attention to something that is in a few use cases crucial for users: being able to use refs with our components.

Not forwarding them means that we don't really support all kinds of rendering, but only the static ones.
If the user intends to build something for themselves that is meant to render the email
components in the browser itself with reactivity we shouldn't have something opposing them.

That is not to say that having the refs here is not confusing, but I'd like to argue that
it is going to be very hard to come across the ref unless the user actually wants it
because of all the common element props that we already forward into all the internal elements of our components.

That being said we probably should also add something in our documentation talking about this
and making this clear, open to any ideas of where to put it. My initial thought is to mention
this idea in a page that explains the philosophy of React Email which might be a great idea to have.

Thanks to @advancedtw for bringing this to our attention on #1286.

@vercel
Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:42pm
react-email-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:42pm

@gabrielmfern gabrielmfern changed the title chore: Add forward ref to all relevant components of ours chore: Add forward ref to all relevant components Feb 8, 2024
@gabrielmfern
Copy link
Member Author

Converting to draft as it seems like Tailwind's media queries are failing here

@gabrielmfern gabrielmfern marked this pull request as draft February 8, 2024 14:33
@gabrielmfern gabrielmfern added the Type: Improvement An improvement, that is, changes to an existing feature that improve it label Mar 6, 2024
@gabrielmfern gabrielmfern self-assigned this Mar 11, 2024
@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from eea0258 to e5d2948 Compare April 29, 2024 19:53
@KingCosmic
Copy link

+1 to this, would love ref support. using react-email with craft.js for visual building of emails.

@fr33z3
Copy link

fr33z3 commented Jun 14, 2024

Would love to see that in the next version release. I truly need this.

@gabrielmfern gabrielmfern force-pushed the chore/add-forward-ref-to-all-components branch from 05b57a9 to 9ca8599 Compare June 25, 2024 17:42
@gabrielmfern gabrielmfern merged commit 9015308 into canary Jun 25, 2024
@gabrielmfern gabrielmfern deleted the chore/add-forward-ref-to-all-components branch June 25, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Improvement An improvement, that is, changes to an existing feature that improve it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants