Likely to cause new Flow errors:
- We removed support for React PropTypes. All related Flow builtin types like
React$PropType$Primitive
are deleted. React has deprecated PropTypes since v15.5. - We will now catch errors related to generic indexed access types. Example
- Fixed issues with indexed access on interfaces/instances. Access with string literals will now access named properties. example
- We now require annotation for computed access of instances, when that access is directly exported.
- The return annotation of a function can now reference a parameter name (e.g try-Flow). This may cause new errors if the return type used to reference a name that aliases a parameter name. This will now be captured by the parameter and cause a [value-as-type] error.
- We now error when using the name of a variable in its own annotation (e.g.
const x: typeof x = ...
). An exception is when the name of the variable appears under an object type constructor. For example, the annotationconst o: { f: typeof o } = ...
is allowed.
Notable bug fixes:
- Fix a bug in the previous version that makes declare let/const function scoped. We fixed it to be lexically scoped again.
Library Definitions:
- Array.flat will now have better typing support for flattening heterogeneous inputs.
e.g. [1, [1,2]].flat()
will now correctly have inferred type ofArray<number>
. - We added support for the following builtin types that are also found in TypeScript: