-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(docs): Preview for components #1733
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
0ed0c71
to
6e5bb82
Compare
6e5bb82
to
e2739f8
Compare
THis PR implements a snippet that allows us to pass in React code that contains
a
Email
constant containing a React component for an example email using thegiven component. An example of its usage would be
It does require us to write the code twice due to Mintlify limitations, as it
does not have a proper component for rendering code outside using common
Markdown backticks.
Another limitation to this snippet caused by Mintlify is that on the CodeBlock
preview, the actual rendered code on the preview looses its indentation due to
some internal problem in Mintlify. We really should address that before merging
this.
On another note, the way this snippet works is by using jsdelivr to get
@react-email/components
and React itself, on an iframe. It has some base codethat is the starting srcDoc for the iframe that uses the code to render and
then writes out the given HTML into the iframe's document. This does give a bit
of a moment of white that makes the experience a bit poorer, but is unavoidable
unless we could use actual React inside the docs.