You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make a Web Component. How do I define my custom Web Component in the CustomElementRegistry? Specifically, how do I pass the constructor as a &js_sys::Function?
Additional Details
#[wasm_bindgen]pubstructWebComponent;#[wasm_bindgen]implWebComponent{#[wasm_bindgen(constructor)]pubfnnew() -> Self{todo!()}}#[wasm_bindgen(start)]pubfnmain(){let window = web_sys::window().unwrap();
window
.custom_elements().define("web-component", ?)// how do I get a &js_sys::Function from WebComponent::new?.unwrap();}
The text was updated successfully, but these errors were encountered:
Summary
I want to make a Web Component. How do I define my custom Web Component in the CustomElementRegistry? Specifically, how do I pass the constructor as a
&js_sys::Function
?Additional Details
The text was updated successfully, but these errors were encountered: