TypeScript/tests/cases/fourslash/tsxGoToDefinitionStatelessFunction2.ts
Kanchalai Tanglertsampan ab2e14f24e Addressing code review in previous PR. Combining below commits
Address comment: fix spelling mistakes

Address comment: calling `checkApplicableSignatureForJsxOpeningLikeElement` from inside `checkApplicableSignature`

Address comment: fix spelling, rename function to be more consistent

Address comment: minor fix indentation, fix function name isObjectLiteralPropertyDeclaration => isObjectLiteralElement

Address PR: gotoDefinition return the last signature when there is an error in statelss function component

Address PR: convert Foreach to for...of

Address comment: fix type, inline code, clarify name of variables
2017-01-19 10:10:03 -08:00

41 lines
1.4 KiB
TypeScript

/// <reference path='fourslash.ts' />
//@Filename: file.tsx
// @jsx: preserve
// @noLib: true
//// declare module JSX {
//// interface Element { }
//// interface IntrinsicElements {
//// }
//// interface ElementAttributesProperty { props; }
//// }
//// interface ClickableProps {
//// children?: string;
//// className?: string;
//// }
//// interface ButtonProps extends ClickableProps {
//// onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
//// }
//// interface LinkProps extends ClickableProps {
//// goTo: string;
//// }
//// declare function /*firstSource*/MainButton(buttonProps: ButtonProps): JSX.Element;
//// declare function /*secondSource*/MainButton(linkProps: LinkProps): JSX.Element;
//// declare function /*thirdSource*/MainButton(props: ButtonProps | LinkProps): JSX.Element;
//// let opt = <Main/*firstTarget*/Button />;
//// let opt = <Main/*secondTarget*/Button children="chidlren" />;
//// let opt = <Main/*thirdTarget*/Button onClick={()=>{}} />;
//// let opt = <Main/*fourthTarget*/Button onClick={()=>{}} ignore-prop />;
//// let opt = <Main/*fivethTarget*/Button goTo="goTo" />;
//// let opt = <Main/*sixthTarget*/Button wrong />;
verify.goToDefinition({
firstTarget: "thirdSource",
secondTarget: "thirdSource",
thirdTarget: "firstSource",
fourthTarget: "firstSource",
fivethTarget: "secondSource",
sixthTarget: "thirdSource"
});