Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When to use <Box>? #29

Open
acomito opened this issue Nov 18, 2016 · 7 comments
Open

When to use <Box>? #29

acomito opened this issue Nov 18, 2016 · 7 comments

Comments

@acomito
Copy link

acomito commented Nov 18, 2016

I keep getting this error anytime I use box inside < Email >

<table> cannot appear as a child of <tbody>. See MyReactComponent > Email > Box > tbody > Box > table.

@brandly
Copy link

brandly commented Dec 5, 2016

@acomito did you figure anything out here? i just ran into the same situation!

@codeVana
Copy link

codeVana commented Dec 8, 2016

@acomito I get these but they are warnings. Email is getting delivered fine.
Warning: Unknown props bgcolor, border, align, valign on

tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
W20161207-21:56:02.102(-8)? (STDERR) in table (created by Box)
W20161207-21:56:02.102(-8)? (STDERR) in Box (created by Email)
W20161207-21:56:02.103(-8)? (STDERR) in body (created by Email)
W20161207-21:56:02.104(-8)? (STDERR) in html (created by Email)

@poshest
Copy link

poshest commented Jan 29, 2017

Don't you have to put the <Box> inside an <Item>? The <Item> is like a <tr><td>, from the docs).

@MartinDawson
Copy link

@acomito @brandly

The reason you are getting this is because the <Email /> component renders a <Box /> element. The box renders a table and then a nested tbody as it's children. By putting a <Box /> inside the <Email /> you are trying to put a table inside a tbody which is invalid html probably. The <Box /> doesn't need to be used here, it's only if you want another table somewhere else.

@kopax
Copy link

kopax commented Oct 10, 2018

@MartinDawson what do you mean by somewhere else ? Do you mean outside <Email /> ?
Would that make sens?

@acomito
Copy link
Author

acomito commented Oct 10, 2018

Update:

I've just been using es6 strings. You can use variables in it. You can easily break them out into component-ish string fragments (you could even make them functions that consume variables.

You can use mailchimps free email builder, then export the html and plop that into a string and go from there.

@rohan-deshpande
Copy link

I agree this is very confusing, the docs are a bit unclear. Basically Email mounts a table and content goes inside tbody so if you try to put a Box inside it'll generate invalid markup. Basically only use Box inside of Item if you want nested tables, otherwise just use Item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants