Coder Social home page Coder Social logo

When to use <Box>? about react-html-email HOT 7 OPEN

chromakode avatar chromakode commented on July 28, 2024 2
When to use ?

from react-html-email.

Comments (7)

brandly avatar brandly commented on July 28, 2024

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

from react-html-email.

codeVana avatar codeVana commented on July 28, 2024

@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)

from react-html-email.

poshest avatar poshest commented on July 28, 2024

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

from react-html-email.

MartinDawson avatar MartinDawson commented on July 28, 2024

@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.

from react-html-email.

kopax avatar kopax commented on July 28, 2024

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

from react-html-email.

acomito avatar acomito commented on July 28, 2024

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.

from react-html-email.

rohan-deshpande avatar rohan-deshpande commented on July 28, 2024

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

from react-html-email.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.