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

Typechecking for non-intrinsic elements in TSX #8330

Closed
tinganho opened this issue Apr 27, 2016 · 3 comments
Closed

Typechecking for non-intrinsic elements in TSX #8330

tinganho opened this issue Apr 27, 2016 · 3 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@tinganho
Copy link
Contributor

I'm using TSX without React. I'm just wondering how do I get type checking for a non-intrinsic element?

<ScrollableContent class='CommentsListContainer' type='vertical' maxHeight={300}/>

the attributes class, type and maxHeight is of type any. I have tried numerous ways to get type checking, but failed. I have also looked at react.d.ts to try to get the solution, but also failed.

The ScrollableContent class is an extension of a generic class:

interface Props {
    class: string;
    maxLength: number;
    type: 'vertical' | 'horizontal';
}

export class ScrollableContent extends Component<Props> {

And I guess just the right interfaces need to be defined in the JSX namespace in order for everything to kick in?

@RyanCavanaugh
Copy link
Member

#3203 outlines how this works

@RyanCavanaugh RyanCavanaugh added the Question An issue which isn't directly actionable in code label Apr 27, 2016
@RyanCavanaugh
Copy link
Member

#5478 as well

@mhegazy mhegazy closed this as completed Apr 27, 2016
@tinganho
Copy link
Contributor Author

Thanks!

@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
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants