gakimball / react-inky

🦑 React components for Inky
https://gakimball.github.io/react-inky
MIT License
21 stars 10 forks source link

Inky components do not render valid <table> HTML #18

Open lawsumisu opened 5 years ago

lawsumisu commented 5 years ago

I make use of react-inky to generate email style templates, and I use enzyme to write unit tests for them. When I run my tests, I get warnings like:

Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. Add a <tbody> to your code to match the DOM tree generated by the browser.

It seems like many of the components that use <table> tags do not include <tbody> tags to contain <tr> elements. Being a warning, this is more of a nuisance than a real issue, but would it be unreasonable to update all the Inky components to render valid tables?

gakimball commented 5 years ago

react-inky imitates the original inky library exactly, so it doesn't use thead or tbody.

I have added a non-strict mode where we can add things that deviate from the original inky library. However, I'm not sure if adding these tags would break things in any clients that Foundation for Emails supports.