sycamore::prelude

Function on_mount

pub fn on_mount(f: impl FnOnce() + 'static)
Expand description

Queue up a callback to be executed when the component is mounted.

If not on wasm32 target, does nothing.

ยงPotential Pitfalls

If called inside an async-component, the callback will be called after the next suspension point (when there is an .await).