Function dioxus_hooks::use_on_create
source · pub fn use_on_create<T, F>(cx: &ScopeState, future: impl FnOnce() -> F)where
T: 'static,
F: Future<Output = T> + 'static,
Expand description
A hook that runs a future when the component is mounted.
This is just use_effect
, but with no dependencies.
If you have no dependencies, it’s recommended to use this, not just because it’s more readable,
but also because it’s a tiny bit more efficient.