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
As you can see, the A and B types are the same, but the key user of the type B has one more field.
When I create a new object of type B by copying my object of type A with a spread operation and adding the new value through it, Flow gives an error.
27: return b;
^ Cannot return `b` because property `address` is missing in object type [1] but exists in object type [2] in property `user`.
References:
5: user: {| ^ [1]
12: user: {| ^ [2]
Hi,
I am trying to override an object with an enriched version of it using the spread operator but flow does not seem to understand.
Am I doing something wrong?
Example here
As you can see, the
A
andB
types are the same, but the keyuser
of the typeB
has one more field.When I create a new object of type
B
by copying my object of typeA
with a spread operation and adding the new value through it, Flow gives an error.gives
Might be related to this issue.
Thanks for your help :)
The text was updated successfully, but these errors were encountered: