Type ‘TypeVariable(T)’ has no method ‘getValue(Nothing?, KProperty<*>)’ and thus it cannot serve as a delegateってエラー

Type ‘TypeVariable(T)’ has no method ‘getValue(Nothing?, KProperty<*>)’ and thus it cannot serve as a delegate

現象

var name by rememberSaveable { mutableStateOf("") }

って構文を使おうとした時にタイトルのエラーでた。

対応

import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue

を追加。

参考

https://www.reddit.com/r/android_devs/comments/jff2vp/jetpack_compose_am_i_stupid_or_is_the_by_remember/

カテゴリー: のーと タグ: , , , パーマリンク

Type ‘TypeVariable(T)’ has no method ‘getValue(Nothing?, KProperty<*>)’ and thus it cannot serve as a delegateってエラー への1件のコメント

  1. ピンバック: Jetpack Composeで調べたこと その3 | N-BLOGΣ(゜Д゜)カッ!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です