Skip to content

JSX types reflect core + compat, when compat may or may not be used #4994

@rschristian

Description

@rschristian

Describe the feature you'd love to see

Stemming from a Twitter thread (TODO: go grab link), it's come up a couple times that Preact's JSX types represent a union of core & compat when the latter isn't guaranteed to be used. For example, strokeWidth, an SVG prop, is a React invention and we only support it when compat is used, but it's not a type error for those just using core.

This makes it really easy to run into frustrating bugs as the types say properties are supported when they're really not from core alone.

Additional context (optional)

I banged my head on this for an hour and got no where, TS namespace and declaration merging is a land of misery, pain, and abysmal documentation quality. Tossing this here though as it's a valid issue, even if I can't address it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions