LoginSignup
1
0

More than 1 year has passed since last update.

この型パラメーターには 'extends object' 制約が必要な場合があります。

Last updated at Posted at 2023-01-22

ジェネリックを使って、functionを作成した時にlintで怒られた。
Object.keysの引数には、1つ以上のプロパティを持つオブジェクトを入れる必要がある。
image.png
そのため、Tに対して extends object を追加することによってlintエラーを回避した。
image.png

object or {} どちらにすれば良いかは下記を参照する
image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0