MyCE = {
let C = p => {
var r = Preact.useRef();
var str = p.name || "world";
Preact.useEffect(() => {
r.current.getRootNode().host.value = str;
r.current.getRootNode().host.dispatchEvent(new CustomEvent("input"));
}, [p.name]);
return htm`
<style>
*{
color:tomato;
}
</style>
<p ref=${r}>hello, ${str}</p>`;
};
try {
define(C, "hello-component", ["name"], { shadow: true });
} catch (e) {}
return C;
}