-
Notifications
You must be signed in to change notification settings - Fork 72
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
useContext does not work #426
Comments
If any of the maintainers think this would be reasonably straight forward to fix (cf requiring a major rearchitecture), then I'm happy to dive in and attempt a PR. |
As a workaround, you can use a different context-like Library (like Jotai or other libraries which don't rely on React.Context). I think React's native context doesn't work here because, in the preview server, React is inlined inside the bundle. But when writing This only affects the preview server. Sending mails with context works fine. |
Thanks @timomeh. I haven't tried Jotai v2, but FYI v1 relied on Context and had the same issues. |
I'm using this with Jotai 1.10 and it successfully reads values from context, both in the preview as well as inside |
Ah great, I must have made a mistake. Will take another look. Thank you. |
Describe the bug
useContext throws an error
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An email with the content "test" should render
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: