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
Basically, keyof Default may contain different keys than T. So anyway, I started writing this code to please the SetOptional signature (although it doesn't make any difference in practice):
interfaceProps{a: string;b: string;[key: string]: unknown;}constdefaults={a: 'bla'};constprops: OptionalDefaults<Props,typeofdefaults>={// complains that a is a required keyb: 'bla',};
My gut feeling is that the constraint on key of SetOptional is not really worth it.
Or that we need at least also a variant without the constraint.
The text was updated successfully, but these errors were encountered:
We have some code like this.
However,
SetOptional
would complain, as it is defined like this:Basically,
keyof Default
may contain different keys thanT
. So anyway, I started writing this code to please the SetOptional signature (although it doesn't make any difference in practice):Now I actually found this code to lead to bugs.
My gut feeling is that the constraint on key of SetOptional is not really worth it.
Or that we need at least also a variant without the constraint.
The text was updated successfully, but these errors were encountered: