Struct next_rs::router::BrowserRouter
source · pub struct BrowserRouter { /* private fields */ }
Expand description
A Router
that provides location information and navigator via [BrowserHistory
].
This Router uses browser’s native history to manipulate session history and uses regular URL as route.
§Note
The router will by default use the value declared in <base href="..." />
as its basename.
You may also specify a different basename with props.
Trait Implementations§
source§impl BaseComponent for BrowserRouterwhere
BrowserRouter: 'static,
impl BaseComponent for BrowserRouterwhere
BrowserRouter: 'static,
§type Properties = ConcreteRouterProps
type Properties = ConcreteRouterProps
The Component’s Properties.
source§fn create(ctx: &Context<BrowserRouter>) -> BrowserRouter
fn create(ctx: &Context<BrowserRouter>) -> BrowserRouter
Creates a component.
source§fn update(
&mut self,
_ctx: &Context<BrowserRouter>,
_msg: <BrowserRouter as BaseComponent>::Message
) -> bool
fn update( &mut self, _ctx: &Context<BrowserRouter>, _msg: <BrowserRouter as BaseComponent>::Message ) -> bool
Updates component’s internal state.
source§fn changed(
&mut self,
_ctx: &Context<BrowserRouter>,
_old_props: &<BrowserRouter as BaseComponent>::Properties
) -> bool
fn changed( &mut self, _ctx: &Context<BrowserRouter>, _old_props: &<BrowserRouter as BaseComponent>::Properties ) -> bool
React to changes of component properties.
source§fn view(&self, ctx: &Context<BrowserRouter>) -> Result<VNode, RenderError>
fn view(&self, ctx: &Context<BrowserRouter>) -> Result<VNode, RenderError>
Returns a component layout to be rendered.
source§fn rendered(&mut self, _ctx: &Context<BrowserRouter>, _first_render: bool)
fn rendered(&mut self, _ctx: &Context<BrowserRouter>, _first_render: bool)
Notified after a layout is rendered.
source§fn destroy(&mut self, _ctx: &Context<BrowserRouter>)
fn destroy(&mut self, _ctx: &Context<BrowserRouter>)
Notified before a component is destroyed.
source§fn prepare_state(&self) -> Option<String>
fn prepare_state(&self) -> Option<String>
Prepares the server-side state.
source§impl Debug for BrowserRouter
impl Debug for BrowserRouter
source§impl FunctionProvider for BrowserRouter
impl FunctionProvider for BrowserRouter
§type Properties = ConcreteRouterProps
type Properties = ConcreteRouterProps
Properties for the Function Component.
source§fn run(
ctx: &mut HookContext,
props: &<BrowserRouter as FunctionProvider>::Properties
) -> Result<VNode, RenderError>
fn run( ctx: &mut HookContext, props: &<BrowserRouter as FunctionProvider>::Properties ) -> Result<VNode, RenderError>
Auto Trait Implementations§
impl !RefUnwindSafe for BrowserRouter
impl !Send for BrowserRouter
impl !Sync for BrowserRouter
impl Unpin for BrowserRouter
impl !UnwindSafe for BrowserRouter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.