Skip to content

Instantly share code, notes, and snippets.

@t4t5
Last active September 6, 2017 14:28
Show Gist options
  • Save t4t5/ded97250f6ab9bf0df097f64d1aa888d to your computer and use it in GitHub Desktop.
Save t4t5/ded97250f6ab9bf0df097f64d1aa888d to your computer and use it in GitHub Desktop.
SweetAlert content option
// 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