Skip to content

Intellisense does not appear in JSX attributes for union types #38849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
NickHeiner opened this issue May 29, 2020 · 0 comments
Open

Intellisense does not appear in JSX attributes for union types #38849

NickHeiner opened this issue May 29, 2020 · 0 comments
Labels
Bug A bug in TypeScript Domain: Quick Info e.g. hover text, tool-tips, and tooltips.
Milestone

Comments

@NickHeiner
Copy link

TypeScript Version: Nightly

Search Terms: intellisense jsx union

Code

import React from 'react';

type Exclusive = {
    /**
     * Original description
     */
    a: boolean;
    b?: never;
} | {
    /**
     * Never description
     */
    a?: never;
    b: boolean;
}

const Component: React.FC<Exclusive> = () => <div></div>;
Component({
    a: true
});
<Component a />;

Expected behavior: The field description for a shows up in intellisense.

Actual behavior: It does not.

Object literal at a normal function call looks good:

image

However, the description does not show up for JSX:

image

When writing using autocomplete to enter a new field:

image

image

Interestingly, JSX works in this case.

Playground Link: link

Related Issues:

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: Quick Info e.g. hover text, tool-tips, and tooltips. labels Jun 12, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Quick Info e.g. hover text, tool-tips, and tooltips.
Projects
None yet
Development

No branches or pull requests

2 participants