Likely to cause new Flow errors:
React.ElementProps
is removed. You should useReact.ElementConfig
instead.- For a function named as a hook but not annotated as a hook, it will no longer be treated like a hook when you try to use it from property access or property destructuring in component syntax components and hook syntax hooks. They will now cause
react-rule-hook-non-hook-syntax
errors. To fix, annotate them with hook annotation. example - Calling functions passed to function and component with hook like name but not annotated as hook will now error. example.
React$RefSetter<...>
and andReact$Context
are removed. It continues to be available in the form ofReact.RefSetter<...>
andReact.Context<...>
, regardless of whether you have importedReact
.React$ElementRef<...>
was removed. It continues to be available in the form ofReact.ElementRef<...>
, regardless of whether you have importedReact
.
Breaking Changes:
- The config option
max_literal_length
was removed. Flow will always decide whether to infer a specific or general type of string literal based on the natural inference algorithm.
Notable bug fixes:
- You can now use
@@dispose
and@@asyncDispose
in your library typings. You can access the respective properties withobj[Symbol.dispose]
andobj[Symbol.asyncDispose]
. - Allow comparisons of bigint singletons
Library Definitions:
- The second type argument of
ExactReactElement
will be populated byReact.ElementConfig<C>
instead ofReact.ElementProps<C>
. Most of the code that doesn't depend on exact react element types won't be affected.