Skip to content

Instantly share code, notes, and snippets.

[version]
0.18.1
// @flow
import React from "React";
class JDiv extends React.Component {
props: {
id: string
};
}
// @flow
import React from "React";
class JDiv extends React.Component {
props: {
id: string
};
render() {
// @flow
import React from "React";
class JDiv extends React.Component {
props: {
id: string
};
}
// @flow
class Foo {
prop1 = 'asdf';
prop2: number;
constructor() {
this.prop2 = this.prop1;
}
}
// @flow
class Foo {
prop1: string = 'asdf';
constructor() {
this.prop1 = 42;
}
}
[options]
esproposal.class_instance_fields=enable
@jeffmo
jeffmo / A.js
Last active October 23, 2015 04:16
/* @flow */
function foo() {
arguments;
}

###v0.18.0

Likely to cause new Flow errors:

  • Flow is now stricter (and more consistent) about how null works when used as an initialization value for object properties that are mutated later. So let o = {prop: null}; o.prop = 42; is now an error and requires that null be annotated: let o = {prop: (null: ?number)};.
  • The return type of RegExp.prototype.match() is now properly annotated to return a nullable.

New Features:

  • We now take advantage of the guarantee that const variables are read-only when doing refinements. This means that refinements of const variables now have much fewer caveats than refinements of lets or vars!

###v0.18.0

Likely to cause new Flow errors:

  • Flow is now stricter (and more consistent) about how null works when used as an initialization value for object properties that are mutated later. So let o = {prop: null}; o.prop = 42; is now an error and requires that null be annotated: let o = {prop: (null: ?number)};.
  • The return type of RegExp.prototype.match() is now properly annotated to return a nullable.

New Features:

  • We now take advantage of the guarantee that const variables are read-only when doing refinements. This means that refinements of const variables now have much fewer caveats than refinements of lets or vars!