There appears to be a real movement to move from Flow to typescript. Is Flow dying?

There have been several projects that were flow based that have moved to TS. I think the real litmus test will be if React eventually either includes TS types or is rewritten in TS.

Disclaimer: I work with TypeScript professionally.

I'm pretty in tune with what's going on around React, and I don't see that one ever happening.

The React team is _very_ busy already with work around Hooks, Concurrent Mode, and Suspense. There's no way they're going to pause development on implementing all these major chunks of functionality just to rewrite from one type system to another.

I've seen Dan express some frustration with Flow's pace of development on Twitter a couple times, but beyond that, no indications whatsoever that React would be converted to TS. In the entirely hypothetical scenario that React _did_ get rewritten to another language, I have to assume it would be something like ReasonML (which was created by Jordan Walke, the original creator of React).

One of the benefits to TypeScript is that the codebase wouldn't need to be rewritten.

A declaration file(s) could be included. There they could just declare types for all classes, methods, constants, etc. Similar to C header files.

(This is how the DefinitelyTyped repository handles typings for untyped source repositories: https://github.com/DefinitelyTyped/DefinitelyTyped)

Ex:

JavaScript: app.js

    function app(arg1, arg2, arg3) {
       // does something
       return {
          key1: someStringValue,
          key2: someNumberValue,
       };
    }
TypeScript: app.d.ts

    declare type AppReturnValue = { key1: string, key2: number };
    declare function app(arg1: string, arg2: string[], arg3: boolean): AppReturnValue;