Skip to content

No string completions in type arguments where constrained to string literal union #52898

Open
@andrewbranch

Description

@andrewbranch

A friend of mine recently tried using JSX generics and it seems like the fix in #34958 did not work for them.

Here is an oversimplified code snippet that replicates the issue. We've tried this in two different machines and neither worked:

import * as React from "react"

type Variations = "hello" | "baaaaa" | "click"

const MyGeneric = <T extends Variations>({  }) => {
  return <div></div>
}

const Issue = () => {
  return <MyGeneric<"ctrl+space should bring up suggestions here">></MyGeneric>
}

Originally posted by @varemenos in #34110 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions