Skip to content

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

Closed as not planned

Description

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions