toJSON

fun toJSON(fields: Map<String, StateField<*>>? = null): Map<String, Any?>

Deprecated

Use toData() with kotlinx.serialization instead.

Replace with

toData(fields)

Convert this state to a JSON-serializable object.