-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
Getting intellisense (auto-complete) from strings literals that belong to a union members in JSX components seems to only work, if we do it inside the "curly braces", if we try to get intellisense from plain "quotes", nothing will come up, even though TS still evaluates well the types.
🔎 Search Terms
#intellisense #string literals
🕗 Version & Regression Information
Since version 4.7, according to my tests, this was working correctly in version 4.6.4.
- This changed between versions 4.6.4 and 4.7.4
⏯ Playground Link
💻 Code
type Props = {age: number} | { name: "box" };
declare function sampleFn(args: Props): any
declare function SampleComponent(args: Props): any
// Intelissense on the `name` property ✅
const a1 = sampleFn({name: "box"});
// Intelissense on the `name` property ✅
const a2 = <SampleComponent name={""} />
// No intelissense on the `name` property ❌
const a3 = <SampleComponent name="" />🙁 Actual behavior
We don't get intellisense:
🙂 Expected behavior
Intesllisense should be available, since it is for regular TS functions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorHelp WantedYou can do thisYou can do this
