TS2559
error TS2559: Type ‘
{ city: string; }
‘ has no properties in common with type ‘User
‘.
Broken Code ❌
1 |
|
Fixed Code ✔️
The problem occurs with weak types (in this case User
). All properties of a weak type are optional but when your input doesn’t match any of the properties, you will get to see error TS2559. To fix it you have to match at least one of the optional properties:
1 |
|