Currently NodeRef returns always a web_sys::Node. To improve type safety and code readability, we could make NodeRef generic, allowing it to be typed directly as e.g. web_sys::HtmlInputElement.
Current state:
let username_input = create_node_ref();
...
let username = username_input.get().dyn_into::<HtmlInputElement>().unwrap().value();
Desired state:
let username_input: NodeRef<HtmlInputElement> = create_node_ref();
...
let username = username_input.get().value();
It would be super convenient if the type could be determined directly from the view macro.
Currently
NodeRefreturns always aweb_sys::Node. To improve type safety and code readability, we could makeNodeRefgeneric, allowing it to be typed directly as e.g.web_sys::HtmlInputElement.Current state:
Desired state:
It would be super convenient if the type could be determined directly from the view macro.