I'm wondering if there's a way I can seed the virtual-dom with a HTML string, without using eval. Below works, using dom2hscript to parse an HTML string into a hyperscript string, then eval it with virtual-dom/h in global scope, however using eval and polluting the global namespace are two things I'd like to avoid.
const lastOutput = eval(dom2hscript.parseHTML(html));
const el = createElement(lastOutput);
I'm wondering if there's a way I can seed the virtual-dom with a HTML string, without using eval. Below works, using
dom2hscript
to parse an HTML string into a hyperscript string, then eval it withvirtual-dom/h
in global scope, however using eval and polluting the global namespace are two things I'd like to avoid.