Function

mutableStateOf

Return a new MutableState initialized with the passed in value The MutableState class is a single value holder whose reads and writes are observed by Compose.

mutableStateOf

Source set: Common
public fun <T> mutableStateOf(
    value: T,
    policy: SnapshotMutationPolicy<T> = structuralEqualityPolicy(),
): MutableState<T>

Return a new MutableState initialized with the passed in value

The MutableState class is a single value holder whose reads and writes are observed by Compose. Additionally, writes to it are transacted as part of the Snapshot system.

Parameters

value the initial value for the MutableState
policy a policy to controls how changes are handled in mutable snapshots.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: