Closed aidan-rypens closed 7 months ago
It's actually never come up before as a need. There are three environments the code runs in;
render
)Because it's React/JSX at the end of the day, the recommendation is to use component props to set all of the data. Then, based on what your target running environment is, you can use envars appropriately to set the props.
It's actually never come up before as a need. There are three environments the code runs in;
- React in the browser
- React in the browser via Vite (preview app)
- A regular Node process (call to
render
)Because it's React/JSX at the end of the day, the recommendation is to use component props to set all of the data. Then, based on what your target running environment is, you can use envars appropriately to set the props.
Thanks @shellscape. Passing through with props is definitely a good way. It didn't came up to my mind at first. Thanks for the suggestion!
Hello!
What's the best practice for using environment variables? This project is using VITE, but I cannot seem to access environment variables.
Couldn't find anything in either this documentation or the fork
.react-email
. Looked a common use case (to me).