github facebook/flow v0.288.0

17 hours ago

Likely to cause new Flow errors:

  • React.ElementProps is removed. You should use React.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 and React$Context are removed. It continues to be available in the form of React.RefSetter<...> and React.Context<...>, regardless of whether you have imported React.
  • React$ElementRef<...> was removed. It continues to be available in the form of React.ElementRef<...>, regardless of whether you have imported React.

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 with obj[Symbol.dispose] and obj[Symbol.asyncDispose].
  • Allow comparisons of bigint singletons

Library Definitions:

  • The second type argument of ExactReactElement will be populated by React.ElementConfig<C> instead of React.ElementProps<C>. Most of the code that doesn't depend on exact react element types won't be affected.

Don't miss a new flow release

NewReleases is sending notifications on new releases.