Skip to content

TS + JSX users should be always using class components only, and this needs to be documented. #9

Open
@dead-claudia

Description

@dead-claudia

TypeScript has slow-walked for years requests to add support for JSX components that 1. are functions (not classes) and 2. return anything other than a JSX.Element value. It's long interfered with React types as well, which only makes this more baffling.

They've even for longer resisted adding support for non-function, non-class components, and the chances of those getting in are probably extremely slim IMHO.

The current long-standing recommendation I've given out for years for TS + JSX users is this: use class components exclusively. It's the only way to make the TS type checker happy. This needs to be included in the documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions