[][src]Struct seed::app::builder::before_mount::BeforeMount

pub struct BeforeMount { /* fields omitted */ }

Implementations

impl BeforeMount[src]

pub fn new() -> Self[src]

Creates a new BeforeMount instance. It's the alias for BeforeMount::default.

pub fn mount_point(self, mount_point: impl MountPoint + 'static) -> BeforeMount[src]

Choose the element where the application will be mounted. The default one is the element with id = "app".

Examples

// argument is `&str`
mount_point("another_id")

// argument is `HTMLElement`

// NOTE: Be careful with mounting into body!
// If you render directly into document.body, you risk collisions
// with scripts that do something with it (e.g. Google Font Loader or
// third party browser extensions) which produce very weird and hard
// to debug errors in production.
// (from https://github.com/facebook/create-react-app/issues/1568)

mount_point(seed::body())

// argument is `Element`
mount_point(seed::body().querySelector("section").unwrap().unwrap())

pub const fn mount_type(self, mount_type: MountType) -> Self[src]

How to handle elements already present in the mount point. Defaults to MountType::Append.

Trait Implementations

impl Default for BeforeMount[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,