pub struct RouterProps<'a> {
    pub children: Element<'a>,
    pub base_url: Option<&'a str>,
    pub onchange: EventHandler<'a, Arc<RouterCore>>,
}
Expand description

The props for the Router component.

Fields

children: Element<'a>

The routes and elements that should be rendered when the path matches.

If elements are not contained within Routes, the will be rendered regardless of the path.

base_url: Option<&'a str>

The URL to point at

This will be used to trim any latent segments from the URL when your app is not deployed to the root of the domain.

onchange: EventHandler<'a, Arc<RouterCore>>

Hook into the router when the route is changed.

This lets you easily implement redirects

Implementations

Create a builder for building RouterProps. On the builder, call .children(...)(optional), .base_url(...)(optional), .onchange(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of RouterProps.

Trait Implementations

The type of the builder for this component. Used to create “in-progress” versions of the props. Read more

An indication if these props are can be memoized automatically.

Create a builder for this component.

Memoization can only happen if the props are valid for the ’static lifetime 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 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.