You are currently viewing the docs for Dioxus 0.4.3 which is no longer maintained.

History Providers

[ HistoryProvider]

The router provides two HistoryProvider]

  • The MemoryHistory]
  • The WebHistory]

By default, the router uses the MemoryHistory]WebHistory]web feature is active, but that is not guaranteed.

You can override the default history:

src/history_provider.rs
#[component]
fn App(cx: Scope) -> Element {
    render! {
        Router::<Route> {
            config: || RouterConfig::default().history(WebHistory::default())
        }
    }
}