* 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
27 lines
407 B
JavaScript
27 lines
407 B
JavaScript
// @flow
|
|
|
|
import React from "React";
|
|
|
|
class JDiv extends React.Component {
|
|
// static defaultProps: { };
|
|
props: {
|
|
id: string
|
|
};
|
|
}
|
|
|
|
// Should be a type error ('id' takes a string, not a number..)
|
|
<JDiv id={42} />;
|
|
|
|
class Example extends React.Component {
|
|
props: { bar: string };
|
|
|
|
render() {
|
|
return <div>{this.props.bar}</div>
|
|
}
|
|
}
|
|
|
|
React.render(
|
|
<Example foo="foo" />,
|
|
document.body
|
|
);
|