Likely to cause new Flow errors:
- Flow will now ban variance annotations in function or function type parameters. example
React.Element
is now opaque, but we still expose some of its internal structure via the bound on the opaque type. You should not depend on the internal structure. In a future release, we plan to makeReact.Element
truly opaque.- Fixed an issue with implicit instantiation in operations over unions that caused many errors to be missed.
- Changed the ref params on
forwardRef
anduseImperativeHandle
to be write-only. Patterns that rely on refining these params to an object and reading the ref field are misusing these APIs. example React.ElementProps
is now more precise when applied toAbstractComponent
s, resulting in the config type of the component rather thanmixed
. This will cause errors when elements of components with different props are passed intoReact.Element<>
types.
Parser:
- We now parse type arguments after
typeof
annotations. e.g.typeof MyGenericClass<string, number>
. Type checking for this syntax is still not supported.
Library Definitions:
- Update
URLSearchParams
definitions (thanks @pascalduez). - Update
AbortSignal
definitions (thanks @pascalduez). - Add
Array
copying methods (toReversed
,toSorted
,toSpliced
andwith
) the$ReadOnlyArray
class definitions (thanks @pascalduez).