minutemailer / react-popup

React popup component
http://minutemailer.github.io/react-popup/
MIT License
208 stars 71 forks source link

New line not working on content property #30

Closed minisemi closed 7 years ago

minisemi commented 7 years ago

Trying to create a new line for the content property of a Popup, but it's not working. Am I perhaps doing it wrong or is it simply not implemented?

Trying to write: content: "Are you sure you want to cancel the following booking? <br> Soccer field"

tbleckert commented 7 years ago

The content property takes either a plane string or a component, you can't use HTML in a string. For example:

{
    content: <div>Are you sure you want to cancel the following booking? <br /> Soccer field</div>
}
minisemi commented 7 years ago

Awesome, thanks! Tried with a var text = "first line <br/> second line" which worked at another place, hence I thought it would here too. But putting it in a div makes more sense, it was just me who presumed it only took strings.

tbleckert commented 7 years ago

Yeah, I just decided to not support it since it can be unsafe. Also it adds a bit more logic to the code.