Skip to main content

mount

Function mount 

Source
pub async fn mount(
    session: &Session,
    name: &str,
    props: HashMap<String, Value>,
) -> Result<String, AppError>
Expand description

Mounts a fresh instance of the component registered as name, storing its initial state server-side (keyed by session) and returning the rendered <div data-wire-id="..."> wrapper - what a @wire(...) codegen call site splices directly into the surrounding page’s HTML.

Every full-page GET through a @wire(...) mount point creates a brand-new component instance (fresh id, freshly mount()-ed state) - there is no cross-navigation persistence, matching Livewire’s own per-page-load semantics. Stale/orphaned session entries are therefore expected on every page view, not a bug - see crate::state::evict_oldest_if_over_cap’s own doc comment for how that’s bounded.