Likely to cause new Flow errors:
React.Element
will now accept a second type argument that specifies the props type. JSX will populate this type argument with actual props passed to component, instead of deriving it from the signature. The change will reveal some broken code, e.g. try-Flow example.$Shape
is deprecated, usePartial
instead. Read this blog post for more.- Add a (temporary) option
tuple_enhancements
to gate our tuple type enhancements (labeled tuple elements, which can be optional or have variance annotations), so we can show a Flow error rather than having users just get syntax errors from various other tooling (e.g. Prettier, ESLint), until all that tooling is updated. experimental.abstract_locations
is removed. Setting this config to true improves Flow's performance. The config defaults to true since 0.139.
New Features:
- Allow opaque types with
string
supertypes to be used as keys in a dictionary, and have that opaque type be preserved when usingObject.keys
. - To help people familiar with TS, error on and supply a quickfix to the Flow equivalent for the TS types:
Readonly
,ReadonlyArray
,ReadonlyMap
,ReadonlySet
,NonNullable
.
Notable bug fixes:
- Error more consistently with
[invalid-computed-prop]
errors. try-Flow. - Fixed cases where uses of
Partial
/Required
caused errors to be positioned poorly.
Misc:
- To improve clarity of error messages we will display
mixed
instead of a generic type if that generic type has a default bound ofmixed
. try-Flow. - Object property type incompatibility errors will now contain additional explanations when the error only arises due to object property invariant subtyping.