You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Argument of type 'InterfaceItem' is not assignable to parameter of type '{ [key: string]: unknown; }'.
Index signature for type 'string' is missing in type 'InterfaceItem'.
my Interface looks like this
interfaceInterfaceItem{text?: string;}
I can work around this when i spread my object like this:
It’s possible that a generic could help here, but there is a pretty vast (see the looseness of the internal type) amount of values to cover here. If you had a suggestion in the form of a PR, we’d be happy to discuss this more closely!
Expected behavior
When I use spreadPros like this:
it would expect it to throw no error
Actual Behavior
When I use spreadPros like this:
I get a TypeScript error
my Interface looks like this
I can work around this when i spread my object like this:
Additional context
if I change the type definition from
to
there is no error thrown, but i don't know if this is the right approach. Could also be related to this: microsoft/TypeScript#50087 (comment)
The text was updated successfully, but these errors were encountered: