Skip to main content

try_mutableStateOf

Function try_mutableStateOf 

Source
pub fn try_mutableStateOf<T: Clone + 'static>(
    initial: T,
) -> Option<MutableState<T>>
Expand description

Like mutableStateOf but returns None if no runtime is available.

Use this when you want to lazily initialize reactive state and gracefully handle the case where the runtime isn’t yet available.