Typescript: Type `T` does not satisfy the constraint `object`

Viewed 374

After installing a package and its @types package. I've started facing this issue here for the following code:

enter image description here

Here's the error:

enter image description here

I actually installed react-draft-wysiwyg and its types, and after that, this already existing code started throwing error.

Any help is appreciated.

1 Answers

AFAIK, The Record type takes 2 arguments

type RecordType<K, T> = Record<K, T>; // this maybe the definition that you want
type MaybeRecord<K, T> = T | RecordType<K, T>; 

Replicating the same error on typescriptplayground, I got the error similar to Generic type 'Record' requires 2 type argument(s). Rather than the one mentioned.

Related