use_attributes!() { /* proc-macro */ }
Expand description
The proc macro that use the yew_html_attribute::HasHtmlAttributes
trait to set and unset the attributes on the html element. It expect to be used on a struct that derive the yew::Properties
trait and the yew_html_attribute::HasHtmlAttributes
trait.
§Arguments
- 1 : The name of the struct that implement the
yew_html_attribute::HasHtmlAttributes
trait - 2 : The reference to the html element
§Example
let node_ref = use_node_ref();
use_attributes!(node_ref, props);
html! {
<>
<input ref={node_ref} type="text" />
</>
}