Files
test-repo/tests/flow/new_react/props4.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

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
);