Skip to content

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

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*asReactfrom'react';typeProps={name: string;isActive: boolean;};exportconstCustomComponent=<Textends{}>(props: Props)=>{return<React.Fragment>{props.name}</React.Fragment>;};exportconstTestComponent=()=>{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

Labels

BugA bug in TypeScriptDomain: LS: 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