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

Unrecognized React JSX component declaration #7020

Closed
PavelPZ opened this issue Feb 11, 2016 · 2 comments
Closed

Unrecognized React JSX component declaration #7020

PavelPZ opened this issue Feb 11, 2016 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue

Comments

@PavelPZ
Copy link

PavelPZ commented Feb 11, 2016

I have this type definition file (principle extracted from https://www.nuget.org/packages/material-ui.TypeScript.DefinitelyTyped/):

declare module TestMod {
  type TTestStyles = 'x' | 'y' | 'z';
  interface TestProps extends React.Props<TestClass> {
    myStyle: TTestStyles;
  }
  interface TestClass extends React.ComponentClass<TestProps> { }
  var Test: TestClass;
}

Using this definition in JSX does not work as expected:

var Test: TestMod.TestClass;

var test = <div>
  <Test myStyle='yy'/> //Display error as expected (Type '"yy"' is not assignable to type '"x" | "y" | "z")
  <TestMod.Test myStyle='yy'/> //Does not display any error
</div>
@RyanCavanaugh RyanCavanaugh reopened this Feb 11, 2016
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Feb 11, 2016
@RyanCavanaugh RyanCavanaugh self-assigned this Feb 11, 2016
RyanCavanaugh added a commit to RyanCavanaugh/TypeScript that referenced this issue Feb 11, 2016
@RyanCavanaugh
Copy link
Member

Fix pending at #7030

@RyanCavanaugh RyanCavanaugh added Fixed A PR has been merged for this issue Domain: JSX/TSX Relates to the JSX parser and emitter labels Feb 11, 2016
@mhegazy mhegazy added this to the TypeScript 1.8.2 milestone Feb 11, 2016
@RyanCavanaugh
Copy link
Member

Fixed; you should see this in the next typescript@next build.

Thanks for the great repro!

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: JSX/TSX Relates to the JSX parser and emitter Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants