#4994·preact

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

Author: rschristianCreated Jan 9, 2026Updated Jan 10, 2026
Labelstypesfeature request

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.