Skip to content

Typechecking for non-intrinsic elements in TSX #8330

Closed
@tinganho

Description

@tinganho

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions