Skip to content

Generic react component (TSX) and intellisense not working #34110

@mjbvz

Description

@mjbvz

from microsoft/vscode#82276

TypeScript Version: 3.7.0-dev.20191011

Search Terms:

  • completions / suggestions
  • react

Code
For a simple typescript react file:

import * as React from 'react';

type Props = {
    name: string;
    isActive: boolean;
};

export const CustomComponent = <T extends {}>(props: Props) => {
    return <React.Fragment>{props.name}</React.Fragment>;
};

export const TestComponent = () => {
    return (
        <CustomComponent<string> |>
            <div></div>
        </CustomComponent>
    );
};
  1. Place cursor at | in <CustomComponent<string>
  2. Trigger completions

Expected behavior:
Completions for name and isActive returned

Actual behavior:
No completions are returned.

If you add a property such as isActive={true}, then a completion for name is returned

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions