事象
以下のようなby
を使ったコード
val state by store.state.collectAsState()
by
に対して
Type 'androidx.compose.runtime.State<com.studiomk.ktca.sample.counter.Counter.State>' has no method 'getValue(Nothing?, KProperty0<*>)', so it cannot serve as a delegate
解決方法
import androidx.compose.runtime.getValue
エラーそのままだがby
は実際にはgetValue
を呼び出している