revivek / oy

Render HTML emails on the server with React.
MIT License
834 stars 47 forks source link

How ignore some warnings? #87

Closed renatocassino closed 5 years ago

renatocassino commented 5 years ago

Hello guys I'm using oy-vey to create Mustache templates using React.

I'm receiving this warning:

Warning: Failed prop type: Relative links can break (i.e. if recipients are outside the company network) and make your content unavailable to view

I want to ignore in some cases, because in my Mustache I have a tag {{#tracker}} that is a function used to change the URL.

Example:

<Link href="http://mywebsite.com" tracked>Link</Link>

// The component Link make this
<A href={createHref(href, tracked)}>Link</A>

// If not tracked
<A href={"http://mywebsite.com"}>Link</Link>
// If tracked
<A href={"{{#tracked}}http://mywebsite.com{{/tracked}}">Link</A>
// This last line return error

I must generate a mustache with this format {{#tracked}}http://mywebsite.com{{/tracked}}

How can I ignore like ESLint this warning?

Thanks for this

revivek commented 5 years ago

Hey there, we don't currently have a way to opt out of warnings if you're using the provided default elements. I would suggest creating your own version of the tag that validates only the propTypes you want.