TypeScript/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx
2017-05-05 08:47:52 -07:00

27 lines
No EOL
504 B
TypeScript

// @filename: file.tsx
// @jsx: preserve
// @noLib: true
// @libFiles: react.d.ts,lib.d.ts
import React = require('react');
interface ComponentProps {
property1: string;
property2: number;
}
export default function Component(props: ComponentProps) {
return (
<AnotherComponent {...props} />
);
}
interface AnotherComponentProps {
property1: string;
}
function AnotherComponent({ property1 }: AnotherComponentProps) {
return (
<span>{property1}</span>
);
}