# setState

inline fun < T , R > R . setState (state: NonNullState < T >, crossinline apply: R .( T ) -> Unit )

Set the Hikage state value.

Usage:

    val textState = mutableStateOf("Hello World!")
    var text by textState
    TextView {
        setState(textState) {
            text = it
        }
    }
    // Modify the state.
    text = "Hello Hikage!"

Content copied to clipboard

#### Parameters

state

the state to be set.

apply

the apply body.

inline fun < T , R > R . setState (state: NullableState < T >, crossinline apply: R .( T ?) -> Unit )

Set the Hikage state value.

#### Parameters

state

the state to be set.

apply

the apply body.

#### See also

setState