Closed CuriosBasant closed 1 month ago
In your situation, you should be using something like:
export default function TestEmail(props: { token: string } = { token: '{{ .Token }}' }) {
return (
<Html>
<Body>
<Text>Your token is:</Text>
<Text>{props.token}</Text>
</Body>
</Html>
)
}
The PreviewProps
are meant to even override this, but only when running email dev
. They are meant to avoid
having to use these kinds of default values to see how the email would look with actual data when running email dev
, so this is indeed expected behavior.
Closing this as not planned. If you have another question, you can also create a discussion for it, which is probably going to be more fitting.
Describe the Bug
I'm using this library to generate emails for supabase email templates. I've my email created like this.
The output that I'm getting on running
email export
is:I just have started using this library, lemme know if I'm missing something or if this is the expected behaviour. Also please point me in the right direction, for how can I achieve my desired result.
Which package is affected (leave empty if unsure)
react-email
Link to the code that reproduces this issue
https://react.email/docs/cli#email-export
To Reproduce
Just try to run
email export
and the generated output doesn't include thePreviewProps
defaults.Expected Behavior
I expected it to generate the
html
file withPreviewProps
as default props.What's your node version? (if relevant)
No response