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 `dangerouslySetInnerHtml` to `MjmlRaw` #16

Closed IanEdington closed 2 years ago

IanEdington commented 2 years ago

15 identifies that MjmlRaw can't use dangerouslySetInnerHtml due to it being kababed in this line:

https://github.com/Faire/mjml-react/blob/780944706c5ad0535933844576ac5dbf6ac95917/src/utils.js#L30

We should allow using dangerouslySetInnerHtml on at least MjmlRaw and possibly other components.

IanEdington commented 2 years ago

The type should be changed in the generate-mjml-react script, probably hereish:

https://github.com/Faire/mjml-react/blob/main-v3/scripts/generate-mjml-react.ts#L148-L180

And it should be excluded from kababification hereish:

https://github.com/Faire/mjml-react/blob/main-v3/src/utils.tsx#L20