Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (9 sloc) 280 Bytes
/**
* Convert HTML string to DOM element.
*/
const htmlToElement = html => {
const placeholder = document.createElement('div');
placeholder.innerHTML = html;
return placeholder.children.length ? placeholder.firstElementChild : undefined;
};
export default htmlToElement;
You can’t perform that action at this time.