Skip to content
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

[bug/jsx]: JSX missing intellisense for discriminant union props #25504

Closed
Hotell opened this issue Jul 8, 2018 · 2 comments
Closed

[bug/jsx]: JSX missing intellisense for discriminant union props #25504

Hotell opened this issue Jul 8, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@Hotell
Copy link

Hotell commented Jul 8, 2018

TypeScript Version: 2.9.2. strict: true

Search Terms:
jsx discriminant unions, jsx unions

Following code works as expected, but intellisense won't work for additional union attributes ( foo / bar ) although if attribute is provided manually, intellisense works as expected (foo->blah OR wat )

Code

import React, { Component } from 'react'

type Props =
  | {
      type: 'foo'
      foo: 'blah' | 'wat'
    }
  | {
      type: 'bar'
      bar: string
    }
class Test extends Component<Props> {
  render() {
    return null
  }
}

const App = () => (
  <>
    {/* missing `foo` attribute intellisene, but works for literal values */}
    <Test type="foo" />;
    {/* missing `bar` attribute intellisene */}
    <Test type="bar" />
  </>
)

Expected behavior:

provide intellisense for supported union attributes

Actual behavior:

ts-jsx-discriminant-union-bug

Related Issues: #21427 #25503

@Hotell Hotell changed the title JSX missing intellisense for discriminant union props [bug]: JSX missing intellisense for discriminant union props Jul 8, 2018
@Hotell Hotell changed the title [bug]: JSX missing intellisense for discriminant union props [bug/jsx]: JSX missing intellisense for discriminant union props Jul 8, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jul 9, 2018

this looks like a duplicate of #25503

@mhegazy mhegazy added the Duplicate An existing issue was already created label Jul 9, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants