Faire / mjml-react

React component library to generate the HTML emails on the fly
https://www.npmjs.com/package/@faire/mjml-react
MIT License
387 stars 17 forks source link

Add default value documentation to props #44

Closed emmclaughlin closed 2 years ago

emmclaughlin commented 2 years ago

Related to #9

We want to see if we can further take advantage of typescript and add information about the props. In this PR we update to provide the MJML default values (i.e. the fallback if the value is undefined)

One caveat here is that this is not a react default/fallback. It is the default from MJML itself. That is why I chose to not use the jsdoc tags, as I feel like they suggest a default value in react, not in MJML itself.

We could alternatively add the value as a default value in React, but this seems superfluous as it forces that value to be set in react when it is a fallback anyway in MJML.

Let me know what you think.

IanEdington commented 2 years ago

related to #9: Hopefully we can expand on this in the future

IanEdington commented 2 years ago

One caveat here is that this is not a react default/fallback. It is the default from MJML itself. That is why I chose to not use the jsdoc tags, as I feel like they suggest a default value in react, not in MJML itself.

That makes sense to me

emmclaughlin commented 2 years ago

related to #9: Hopefully we can expand on this in the future

If by expand you mean look at adding descriptions from the MJML documentation we will look into that. These are all of the default values available from the MJML documentation though so we are maxed out on default value information