-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spreading $Shape of exact type is same as spreading of same exact type #6906
Comments
Any updates on this issue? Is this a bug then in flow or are we misusing the spread operator with the $Shape type because we don' understand some behavior going on here? |
Shape doesn't behave quite as it states in the docs. To make all the keys optional, you can do something like this:
Here's a link to Try Flow: https://flow.org/try/#0C4TwDgpgBACghgJ2ASzgGwDwBUB8UC8UAJAKIAecAxsBgN4B0jDjWAvqzgNwBQ3okUAIIEotAD5QAZgHtpALigA7AK4BbAEYQEUMax79oAIRHio6xAoDOwBMkUBzHXr7hoAYWwAaKAFU8hcW4oYMZ6LE8gkMZ4JFRMP25dHm5KaUVrKEoFD0FvQ39RSJl5KABGCODzAC8FABZuPSA |
Ok, I've been using the following instead actually:
|
Thanks to facebook/flow#6906 for this `Partial` type -- a workaround for `$Shape` not working correctly. See also facebook/flow#7298.
Thanks to facebook/flow#6906 for this `Partial` type -- a workaround for `$Shape` not working correctly. See also facebook/flow#7298.
Would it make sense to define |
Thanks to facebook/flow#6906 for this `Partial` type -- a workaround for `$Shape` not working correctly. See also facebook/flow#7298.
Now that https://github.com/facebook/flow/releases/tag/v0.162.0 includes |
It seems like yes: flow.org/try |
It seems when spreading a
$Shape
of an exact type, it doesn't actually spread on type$Shape<T>
but just spreads onT
instead. The following breaks in try flowThe text was updated successfully, but these errors were encountered: