Like TypeScript, Flow checks your code for errors through static type annotations. These types allow you to tell Flow how you want your code to work, and Flow will make sure it does work that way.
Flow is a library developed by Facebook, which makes it really easy to use it inside a React app. You can also adopt Flow incrementally and easily remove it at anytime, so you can try Flow out on any codebase and see how you like it.
Why choose flow over TypeScript?
So we know that this type checking mechanic is pretty amazing, but why would you want to use Flow instead of TypeScript if TypeScript also has the same feature, plus more?
Out of the box
Flow can automatically infer type information from existing code and pick up any type errors by itself (TypeScript actually tries to do the same from version two). All you need to do to get this functionality (aside from installing and configuring Flow, of course) is add a single line of code:
While if you want to use Typescript, you need to write the code in files with different extension (.ts, .tsx) and setup more complex initial configuration.
Better compatibility with some libraries/frameworks/compilers
While it is true that it is possible to use TypeScript with React, the React ecosystem is originally not optimized to work well with TypeScript, often requiring additional adjustment to your code.
Why choose TypeScript anyway?
Above all TypeScript can work really well in Node.js environments. In back-end development, it’s even more important to keep track of what’s going on in your code. It also works really well with interfaces, and brings some features, like abstract classes, that can become handy if our goal is to develop complex scalable solution in the right “object oriented way”.
In combination of both back-end and front-end parts of our application, we can achieve lots of benefits, like the possibility of sharing interfaces, or parts of code, that are common for both parts of our application.
Both solutions have it’s benefits and can be more effective for different kinds of applications, you can learn more about both of them here https://www.typescriptlang.org/ and here https://flow.org/en/ Good luck with you code and remember. Choose wisely