prettier/tests/flow/react_functional/__snapshots__/jsfmt.spec.js.snap

29 lines
787 B
Plaintext
Raw Normal View History

exports[`test test.js 1`] = `
2016-12-30 19:56:42 +03:00
"import React from \"react\";
function F(props: { foo: string }) {}
<F />; // error: missing \`foo\`
<F foo={0} />; // error: number ~> string
2016-12-30 19:56:42 +03:00
<F foo=\"\" />; // ok
// props subtyping is property-wise covariant
function G(props: { foo: string|numner }) {}
2016-12-30 19:56:42 +03:00
<G foo=\"\" />; // ok
var Z = 0;
<Z />; // error, expected React component
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import React from \"react\";
function F(props: { foo: string }) {}
<F />; /* error: missing \`foo\`*/
<F foo={0} />; /* error: number ~> string*/
<F foo=\"\" />; // ok
2016-12-27 21:29:31 +03:00
// props subtyping is property-wise covariant
function G(props: { foo: string | numner }) {}
<G foo=\"\" />; // ok
var Z = 0;
2017-01-11 18:16:38 +03:00
<Z />; // error, expected React component
"
`;