2016-12-23 22:31:38 +03:00
|
|
|
/**
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
2017-04-08 17:52:38 +03:00
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
const Example = React.createClass({
|
2016-12-23 22:31:38 +03:00
|
|
|
propTypes: {
|
2017-04-08 17:52:38 +03:00
|
|
|
get a() { return React.PropTypes.number.isRequired; },
|
2016-12-23 22:31:38 +03:00
|
|
|
set b(x: number) { this.c = x; },
|
2017-04-08 17:52:38 +03:00
|
|
|
c: React.PropTypes.string,
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
});
|
2017-04-08 17:52:38 +03:00
|
|
|
|
|
|
|
(<Example />); // error: property `a` not found
|
|
|
|
(<Example a={0} />); // ok
|
|
|
|
(<Example a="bad" />); // error: number ~> string
|
|
|
|
(<Example a={0} c={0} />); // error: number ~> string
|