Files
test-repo/tests/flow/new_react/new_react.js
T
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00

33 lines
768 B
JavaScript

var React = require('react');
var Mixin = require('Mixin');
var C = React.createClass({
mixins: [Mixin],
propTypes: {
x: React.PropTypes.string.isRequired,
y: React.PropTypes.array,
z: React.PropTypes.number
},
replaceProps(props: { }) { },
getDefaultProps(): { z: number } {
return { z: 0 };
},
getInitialState() { return 4; },
render() {
var foo: string = this.state;
var bar: string = this.props;
var qux: string = this.props.z;
var w:number = this.props.x;
this.props.y[0];
var len:number = this.props.x.length;
this.success();
return <div/>;
}
})
var element = <C x = {0}/>;
var element_ = <C/>;
var x: number = C.displayName;