3 ms·
>you have to explicitly set TypeScript to treat all types as non-nullable by default to get behavior similar to Flow's default To be fair, it's one line in a c
by Arnavion 10y ago
>you have to explicitly set TypeScript to treat all types as non-nullable by default to get behavior similar to Flow's default
To be fair, it's one line in a config file / tsc commandline.
>Flow uses nominal typing (similar to functional languages); whereas, TypeScript uses structural typing (similar to Java)
Flow also uses structural typing, except for ES6 classes which it considers nominally typed.
>I don't remember the ramifications of this, but I think one was it makes Flow easier to work with/require less boilerplate
I can't imagine how that's related.
>I think the nullable operator was one case, where the operator Microsoft chose could be ambiguous with JavaScript code in Flow, so Facebook chose a different one.
I think you're talking about the type assertion operator which used to be angle brackets in TS. Yes it would cause syntax ambiguities with JSX. Since Flow had JSX support from the start for React, they chose a different operator (?:). When TS added support for JSX, they added another type assertion operator (as).