DEV Community

Discussion on: static type JavaScript

Collapse
 
cheshireswift profile image
☕ツ

Unless I'm very mistaken, this is not correct regarding Flow.

Flow types are stripped out at runtime; it is checked using an ongoing language server (which in practice is how Typescript is generally checked), and it isn't React specific any more than Typescript is Angular specific. In both cases they're just ways for specifying types on top of Javascript, and all support for libraries just comes from type definitions someone else has written up.

The main difference between the two is that Typescript is more popular so has a much better pool of prewritten typedefs for external libraries.

(p.s. Thinking about the specifics of what you've said, are you thinking of prop-types? Because Flow is a separate thing, much closer to TS than it is to prop-types.)

Collapse
 
devkevyn profile image
devkevyn • Edited

My mistake. I was thinking of prop types! You're right about all of those. I mistakingly interchanged them (was replying to this at 2 am). Thanks for correcting me.

Thread Thread
 
cheshireswift profile image
☕ツ

No worries, we've all been there 😁