Last active
September 6, 2017 14:28
-
-
Save t4t5/ded97250f6ab9bf0df097f64d1aa888d to your computer and use it in GitHub Desktop.
SweetAlert content option
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A React component... | |
const List = () => ( | |
<ul> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
</ul> | |
) | |
// Render it as a DOM node... | |
const wrapper = document.createElement() | |
ReactDOM.render(<List />, wrapper) | |
const listEl = wrapper.firstChild | |
// And pass the DOM node to SweetAlert! | |
swal({ | |
text: "Here's a list:", | |
content: listEl, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment