pub struct H<T> { /* private fields */ }
Expand description

The component builder that powers h!, which provides convenience methods for adding props.

In case T is HtmlTag, H<T> also provides auto-completion for HTML attributes and events.

Implementations

Sets a fallback when loading lazy descendant components.

Provides auto-completion for DOM attributes on H.

Equivalent to props.dangerouslySetInnerHTML = { __html: value.__html };.

See also React documentation.

Example
fn create_markup() -> DangerousHtml<'static> {
  DangerousHtml {
    __html: "First &middot; Second".into()
  }
}

h!(div)
  .dangerously_set_inner_html(&create_markup())
  .build(c![])

Overwrites the class name attribute. Use h! for easier way to set the class names.

Sets the style attribute.

Provides auto-completion for DOM events on H.

Creates a new instance of H. It is recommended to use the h! macro instead.

Sets the React key.

Sets the React ref to the given ref container created with the use_js_ref() hook.

Sets the React ref to the given ref callback.

Sets an attribute on the VNode.

Sets a callback value to an attribute on the VNode.

Builds the VNode and returns it with the given children. Use c! for easier construction of the children.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.