Struct ruukh::App

source ·
pub struct App<COMP>where
    COMP: Render<Props = (), Events = ()>,
{ /* private fields */ }
Expand description

The main entry point to use your component and run it on the browser.

Implementations

Create a new App with a Component struct passed as its type parameter.

The component that is mounted as an App should not have any props and events declared onto it.

Example
let my_app = App::<MyApp>::new();

Mounts the app on the given element in the DOM.

The element may be anything that implements AppMount. You may pass an id of an element or an element node itself.

Example
App::<MyApp>::new().mount("app");

Trait Implementations

Create a new App with a component COMP that has void props and events.

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 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.